UVaLive 2796 Concert Hall Scheduling (minimum cost flow)

Meaning of the questions: a famous concert hall because of the deteriorating financial situation of going into bankruptcy, you stepped in to try to save it by means of management, one way is to optimize the performance schedule, both performance wise decision to accept or reject the application for which the orchestra, making music Office of profit maximization. The concert hall has two identical rooms, so a band does not specify the room at the time of application performance, you only need to assign a random. Each show will continue for several days, each room can only hold a show every day. N is the number of applications a positive integer not exceeding 100, each application with three integers i, j, denoted w, represents the i-th day to day j, w membered willing to pay.

Analysis: setting node 366, represents 365 days (node ​​1 to node 2 for the first day). Super source is provided, connected to the first node, a capacity of 2 (two Hall), the cost is zero. Setting super sink, so that the node 366 is connected to a capacity of 2, the cost is zero. Then, the first 365 nodes, each node connected to his next node, a capacity of 2, the cost is 0, it indicates the passage of time. Finally, for each application, I j + 1 is connected to one side, a capacity of 1, negative charges w. Running cost flow. Construction Plan is as follows.

Summary: interval (timing) model, the shorter the interval, a year directly to the demolition of several points all day, connected in sequence represents the passage of time.

Code: to be completed.

Guess you like

Origin blog.csdn.net/tianwei0822/article/details/92798898