1 / 9

d092: iRobot

d092: iRobot. Po-Lung Chen Team Dont Block Me, National Taiwan University March 26, 2010. Problem Description. Dr. John build some mazes to test some newly designed robots, called iRobots , whether they have the ability to collect the minerals cooperatively.

Download Presentation

d092: iRobot

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. d092: iRobot Po-Lung Chen Team Dont Block Me, National Taiwan University March 26, 2010

  2. Problem Description • Dr. John build some mazes to test some newly designed robots, called iRobots, whether they have the ability to collect the minerals cooperatively. • In a maze with rows and columns, every iRobot can move on 4 directions in 1 step. • They can move onto an open cell (including cells that contain mineral or another iRobot.) • Now, there are MiRobots and M cells of mineral in the maze. Minimize the total number of steps that each iRobot collect distinct cells of mineral.

  3. Example R R M M Answer: 18

  4. Solution(1/2) • This is a minimum cost maximum matching problem.

  5. Solution (2/2) • We can use the Hungarian Algorithm to solve this problem, see • http://en.wikipedia.org/wiki/Hungarian_algorithm • But this algorithm is difficult to implement well in short period of time (i.e. during the contest.) • Better to prepare it in your own toolbox. • The number of iRobots is no more than 20. • The graph is small, so we can run a simple shortest path algorithm for augmenting.

  6. The Algorithm (1/2) • We first construct the graph, set each directed edge has capacity 1, flow 0, and cost to be the minimum distance from an iRobot to a mineral cell. • If an iRobot cannot move to a certain mineral cell, do not construct this edge. • Then for each augment iteration, we find the min-cost augmenting path using the shortest path algorithm (such as the Floyd-Warshall’s or Bellman-Ford’s). • Why No Dijkstra’s? • Why So Serious?

  7. The Algorithm (2/2) • After found a shortest path, we invert the direction of each edge on this path and set their weights to be negative (or positive, if the weight on an edge is negative.) • Then add the cost to the answer. • After M iterations we then have found the minimum cost to the problem.

  8. Related Problems • There are some problems for min/max-cost maximum matching problems in PTC. • d022: Course Enrollments • d072: On Sale • d094: Shipping Containers

  9. Finally… Thanks for your attention!

More Related