Presentation on theme: "ENM 503 Lesson 7 – Discrete Models Combinatorial Problems and their Solutions I am very discrete."— Presentation transcript:
ENM 503 Lesson 7 – Discrete Models Combinatorial Problems and their Solutions I am very discrete.
The Lineup The General Problem The Transportation Problem The Assignment Problem The Knapsack Problem The Traveling Salesman Problem The Postman problem
The General IP Problem Why this is just a linear program with integer restrictions on the variables.
Combinatorial Optimization Problems Optimization problem having a finite number of discrete solutions. One solution approach is to explicitly generate and evaluate all possible solutions Explicit enumeration Consider an IP problem with 100 variables where x j = 0, 1, 2, …, 50; j = 1,2, …, 100 number of possible solutions = Explicit enumeration not possible Implicit enumeration – attempt to account for all possible solution without enumerating all of them
An Integer Program x1x1 x2x max z = x 1 + 5x 2 subj to: x x 2 20 x 1 2 x 1, x 2 are integers.... lattice points
Why not just round the LP solution? x1x1 x2x LP solution x 1 = 2, x 2 = 9/5 z * = 11 round (2,2) infeasible Animated max z = x 1 + 5x 2 subj to: x x 2 20 x 1 2 x 1, x 2 are integers
Rounding doesn’t always work! x1x1 x2x optimal IP solution x 1 = 0, x 2 = 2 z = 10 feasible rounded solution x 1 = 2, x 2 = 1 z = 7 Animated max z = x 1 + 5x 2 subj to: x x 2 20 x 1 2 x 1, x 2 are integers LP solution x 1 = 2, x 2 = 9/5 z * = 11
An IP Example Max z = 4.8x x x x 4 subj. to: x 1 + x 2 + x 3 + x 4 x x x x 4 x x x x 4 x x x x 4 125 x 1, x 2, x 3, x 4 = 0, 1, 2, …
The Solutions LP Solution rounded LP Solution IP Solution x1x2x3x4 unit profit Max variables sumprodRHS Const <=50 Const <=150 Const <=400 Const <=125 x1x2x3x4 unit profit Max variables sumprodRHS Const <=50 Const <=150 Const <=400 Const <=125 x1x2x3x4 unit profit Max variables sumprodRHS Const <=50 Const <=150 Const <=400 Const <=125
Feasible Rounding feasible rounded LP Solution IP Solution x1x2x3x4 unit profit Max variables sumprodRHS Const <=50 Const <=150 Const <=400 Const <=125 x1x2x3x4 unit profit Max variables sumprodRHS Const <=50 Const <=150 Const <=400 Const <=125
The Assignment Problem Assign n workers to n tasks I heard that this is really good!
Some Applications workers to tasks jobs to machines facilities to locations Truck drivers to customer pick-up points Umpire crews to baseball games Judges to court dockets State inspectors to construction sites Weapons to targets These are some terrific applications.
A problem Three workers are to be assigned to one of 4 distinct tasks. Each worker can perform each task in a different time. The objective is to minimize the total time to complete the assigned tasks. worker task times We need to add a dummy worker. timetask1task2task3task4 w w w
The Knapsack Problem A total of m items whose weights are a 1, a 2, …, a m are available for packing a knapsack. The total weight to be packed cannot exceed b. The objective is to pack as many items as possible.
An Example – solver binary solution Valueweight x108.5 x213.7 x311.9 x412.8 x514.7 x606.9 x708.7 x813.3 x905.8 x x x x x x x x x x x sum929.9 <= 30 Valueweight x118.5 x213.7 x311.9 x412.8 x514.7 x606.9 x708.7 x813.3 x905.8 x x x x x x x x x x x sum1040 <= 40 Valueweight x108.5 x203.7 x311.9 x412.8 x514.7 x616.9 x708.7 x813.3 x915.8 x x x x x x x x x x x sum <= 50
New and Improved Knapsack Problem Let c j = cost of the i th item w j = weight of the j th item v j = volume of the j th item It is comforting to know my load is optimal!
Example – new and improved
Let’s count the number of solutions… Dad, how many solutions are there for the knapsack problem if I have 30 items to consider? You should know that Johnny. It is 2 30 or 1,073,741,824 solutions if you include the infeasible ones as well.
The Traveling Salesman Problem There once was a farmer’s daughter… You got to know the territory!
Traveling Salesman Problem A salesman must visit each of n cities once and only once returning to his starting city. What route should be followed so that the total distance (cost or time) traveled is minimized? (n-1)! possible routes Itinerary Dayton Cincinnati Denver New York Atlanta Chicago Boston San Francisco Wapakoneta My secretary always finds for me, the minimum distance itinerary.
A From-to Matrix From / To City ACity BCity CCity D City A City B City C City D distances in miles
Traveling on a network A B C D E F G 6! = 720 routes A solution is a permutation!
A Traveling Salesman Problem P. Rose, currently unemployed, has hit upon the following scheme for making some money. He will guide a group of people on a tour of all National League baseball parks. The tour will start and end in Cincinnati. What route should he follow in order to minimize total distances (costs)?
Distances between parks in miles ATL CHI CIN HOU LA MON NY PHI PIT STL SD SF ATL CHI CIN HOU LA MON NYK PHI PIT STL SD SF
Heuristics -algorithm development I need a good heuristic to solve this problem. Joe EngineerP. Rose Heuristic: A procedure for solving problems by an intuitive approach in which the structure of the problem can be interpreted and exploited intelligently to obtain a reasonable solution.
Nearest Neighbor Heuristic – a greedy heuristic algorithm ATL CHI CIN HOU LA MON NY PHI PIT STL SD SF ATL CHI CIN HOU LA MON NYK PHI PIT STL SD SF
LAXSNFCIN MON SNDATLHOUCHIPITSTLPHINYK DISTANCE = 8015 MILES
LAXSNFCIN MON SNDATLHOUCHIPITSTLPHINYK DISTANCE = 8015 MILES X X OPTIMUM = 7577 MILES
Other Applications manufacture of circuit boards assembly line reconfiguration mixing paints colors in vats searching for stars
The Chinese Postman Problem A study in the optimal delivery of the postal mail
The problem defined The Chinese postman problem concerns a postman who has to deliver mail to houses along each of the streets in a particular housing estate, and wants to minimize the distance that has to be walked. The problem was first considered by the Chinese mathematician Mei-ko Kwan in the1960s. Based on this Alan Goldman suggested the name "Chinese Postman problem" to Jack Edmonds when Edmonds was in Goldman's Operations Research group at the U.S. National Bureau of Standards (now NIST). Edmonds appreciated its "catchiness" and adopted it.
More of the Chinese Postman Problem Given a network with distances assigned to each arc, find the minimum distance walk that walks each arc at least once and returns to the starting node A B C D E F G I get tired walking this route. It is too long.
The Bridges of Königsberg Königsberg (Kaliningrad) was a city in Prussia situated on the Pregel River, which served as the residence of the dukes of Prussia in the 16th century. The river Pregel flowed through the town, creating an island. Seven bridges spanned the various branches of the river, as shown.
Graph Theory and the Bridges of Königsberg A famous problem concerning Königsberg was whether it was possible to take a walk through the town in such a way as to cross over every bridge once, and only once. An example of a failed attempt to take such a walking tour is shown below. How many bridges must I cross?
Now comes Euler This problem was first solved by the Swiss mathematician Leonhard Euler who invented the branch of mathematics now known as graph theory in the process of his solution. Euler's approach was to regard the spots of land (there are 4 of them) as points to be visited, and the bridges as paths between those points. The mathematical essentials of the map of Königsberg can then be reduced to the following diagram, which is an example of what is called a graph:
Leonhard Euler Euler was the most prolific writer of mathematics of all time. He made large bounds forward in the study of modern analytic geometry and trigonometry where he was the first to consider sin, cos etc. as functions rather than as chords. He made decisive and formative contributions to geometry, calculus and number theory. He integrated Leibniz's differential calculus and Newton's method of fluxions into mathematical analysis. He introduced beta and gamma functions, and integrating factors for differential equations. He studied continuum mechanics, lunar theory, the three body problem, elasticity, acoustics, the wave theory of light, hydraulics, and music. He laid the foundation of analytical mechanics. Born: 15 April 1707 in Basel, Switzerland Died: 18 Sept 1783 in St Petersburg, Russia
Network Terminology Graph – a finite set of points (vertices or nodes) together with a finite set of connecting links called edges (arcs or branches). Each edge connects two different vertices Path – a sequence of edges in a graph where consecutive edges have the same vertex. Circuit – a path which starts and ends at the same vertex Euler circuit – a circuit in which each edge of the graph is used exactly once
Euler's Solution When a vertex is "visited" in the middle of the process of tracing a graph, there must be an edge coming into the vertex, and another edge leaving it; and so the order of the vertex must be an even number. This must be true for all but at most two of the vertices--the one you start at, and the one you end at A connected graph is traversible if and only if it has at most two vertices of odd order. (the starting and ending vertices may be the same, in which case the order of every vertex must be even.) The Königsberg graph shows that there are more than two vertices of odd order, and so the desired walking tour of Königsberg is impossible.
Euler Solution If there are no odd nodes in the network, the network is certainly traversable. The minimum distance is the sum of the arc distances and any Eulerian trail is an acceptable shortest route, so the problem is trivial. If a Euler circuit does not exist, then the problem is to find a circuit that covers all the edges of a given graph with the minimum number of duplications. If v 0 is the number of odd-ordered vertices, then no fewer than v 0 / 2 additional edges are necessary.
Other Applications delivery mail, newspaper, door-to-door soliciting trash pickup snow plowing and salting streets, street cleaning railroad track inspections and maintenance meter reading school bus routes
Play ball! Now it’s your turn. The Department of Engineering Management & Systems has proudly presented Discrete Models and Methods