Is this MSP an instance of the TSP?

∥☆過路亽.° 提交于 2020-01-13 06:52:10

问题


In his book, The Algorithm Design Manual, Steven S. Skiena poses the following problem:

            

Now consider the following scheduling problem. Imagine you are a highly-indemand actor, who has been presented with offers to star in n different movie projects under development. Each offer comes specified with the first and last day of filming. To take the job, you must commit to being available throughout this entire period. Thus you cannot simultaneously accept two jobs whose intervals overlap.

For an artist such as yourself, the criteria for job acceptance is clear: you want to make as much money as possible. Because each of these films pays the same fee per film, this implies you seek the largest possible set of jobs (intervals) such that no two of them conflict with each other.

For example, consider the available projects in Figure 1.5 [above]. We can star in at most four films, namely “Discrete” Mathematics, Programming Challenges, Calculated Bets, and one of either Halting State or Steiner’s Tree.

You (or your agent) must solve the following algorithmic scheduling problem:

Problem: Movie Scheduling Problem

Input: A set I of n intervals on the line.

Output: What is the largest subset of mutually non-overlapping intervals which can be selected from I?

I wonder, is this an instance of the TSP (perhaps a simplified one)?


回答1:


This problem can be solve by simply choosing the film with the earliest finish date, and proceeding from there, an O(n^2) process (there may be even faster solutions). Since we've found a polynomial time solution, it's not an instance of TSP, unless: (1) P=NP, and (2) there's an embarrassingly easy proof of (1).




回答2:


Here's how to approach this problem:

  1. Create a tree with the vertices being the films and the edges being overlaps. That is, two vertices are connected by an edge iff their schedule overlap. Thus the problem can be restated like this: "Given a graph G find the maximal subset of unconnected vertices."

  2. Now one can relate the above problem to the known NP-hard problem. Specifically, create a graph G' with the same vertices and complimentary edges. That is, G' has an edge between vertices iff the original graph G didn't have it. Now the problem can be restated like this: "Given a graph G' find the maximal clique, where a clique is a subset of vertices all of which are connected to each other."

Clique is a well-know NP-hard problem. Because your scheduling problem is equivalent to Clique - voila! It's NP-hard too.



来源:https://stackoverflow.com/questions/18412923/is-this-msp-an-instance-of-the-tsp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!