Presentation is loading. Please wait.

Presentation is loading. Please wait.

Combinatorial Optimization Lecturer Kononov Alexander Veniaminovich.

Similar presentations


Presentation on theme: "Combinatorial Optimization Lecturer Kononov Alexander Veniaminovich."— Presentation transcript:

1 Combinatorial Optimization Lecturer Kononov Alexander Veniaminovich

2 Combinatorial Optimization Computational problems are not only things that have to be solved, they are also objects that can be worth studying. Problems and algorithms can be formalized and analyzed mathematically. C.H.Papadimitriou

3 A Wolf, A Goat and a Cabbage A man finds himself on a riverbank with a wolf, a goat, and a head of cabbage. He needs to transport all three to the other side of the river in his boat. However, the boat has room for only the man himself and one other item (either the wolf, the goat or the cabbage). In his absence, the wolf would eat the goat, and the goat would eat the cabbage. Show how the man can get all these passengers to the other side.

4 Jigsaw Puzzle Assembly A jigsaw puzzle contains 500 pieces. A “section” of the puzzle is a set of one or more pieces that have been connected to each other. A “move” consists of connecting two sections. What is the minimum number of moves in which the puzzle can be completed.

5 A Fake Among Eight Coins There are eight identical-looking coins; one of these coins is counterfeit and is known to be lighter than the genuine coins. What is the minimum number of weighings needed to identify the fake coin with a two-pan balance scale without weights.

6 Making Pancakes You have to make n ≥ 1 pancakes using a skillet that can hold only two pancakes at a time. Each pancake has to be fried on both sides; frying one side of a pancake takes 1 minute, regardless of whether one or two pancakes are fried at the same time. Design an algorithm to do this job in the minimum amount of time. What is the minimum amount of time as a function of n?

7 Team Ordering Suppose you have the results of a completed round-robin tournament in which n teams played each other once. Assuming there were no ties, is it always possible to list the teams in a sequence so that every team won the game with the team listed immediately after it?

8 How long people are interested in similar problems?

9 The Königsberg bridge problem Was it possible, in a single stroll, to cross all seven bridges of Königsberg exactly once and return to the starting point? The problem is solved by Euler (1736).

10 Propositiones ad acuendos juvenes "Problems to sharpen the young” ( ~800 A.D, Alcuin ) –18. Puzzle of the wolf, a goat and the cabbages. –27. Puzzle of the four-sided city. There is a four-sided city which has one side of 1100 feet, another side of 1000 feet, a front of 600 feet, and a final side of 600 feet. I want to put some houses there so that each house is 40 feet long and 30 feet wide. How many houses ought the city to contain? –28. Puzzle of the triangular city.

11 How do people (not mathematics) solve such problems?

12 Two strongly opposite methods. Exhaustive search Greedy Approach

13 Exhaustive search Theoretically, many combinatorial problems (puzzles) can be solved by exhaustive search --- a problem-solving strategy that simply tries all possible candidate solutions until a solution to the problem is found.

14 Disadvantage of the method The most important limitation of exhaustive search is its inefficiency: as a rule, the number of solution candidates that need to be processed grows at least exponentially with the problem size, making the approach inappropriate not only for human but often for a computer as well.

15 Magic Square Fill the 3×3 table with nine district integers from 1 to 9 so that the sum of the numbers in each row, column, and corner-to-corner diagonal is the same.

16 Magic Square Fill the 3×3 table with nine district integers from 1 to 9 so that the sum of the numbers in each row, column, and corner-to-corner diagonal is the same. Solving this problem by exhaustive search would imply generating all 362880 possible arrangements of distinct integers from 1 to 9 in the table and checking for each of the arrangements, whether all its row, column and diagonal sums are the same.

17 Magic Square 5×5 The number of candidate solutions the exhaustive search algorithm is equal to (5 2 )!. It would take a computer making 10 trillion operations per second about 49000 years to finish the job.

18 Running time Let A be an algorithm which accepts inputs from a set X, and let f:D  R +. If there exist a constant α>0 such that A terminates its computation after at most αf(x) elementary steps (including arithmetical operations) for each input x  X, then we say that A runs in O(f) time. We also say that the running time (or the time complexity) of A is O(f).

19 Input size The input size of an instance with rational data is the total number of bits needed for the binary representation.

20 Polynomial-time algorithm Definition 1.4 An algorithm with rational input is said to run in polynomial time if there is an integer k such that it runs in O( n k ) time, where n is the input size, and all numbers in intermediate computations can be sorted with O( n k ) bits. An algorithm with arbitrary input is said to run in strongly polynomial time if there is an integer k such that it runs in O( n k ) time for any input consisting of n numbers and it runs in polynomial time for rational input. In the case k=1 we have a linear-time algorithm.

21 Greedy Approach The greedy approach solves an optimization problem by a sequence of steps, each expanding a partially constructed solution until a complete solution is reached. At each step --- and this is the central point of this strategy --- the choice is to produce the largest immediate gain without violating the problems constraints. This simple minded approach works in some cases and fails in others.

22 Non-Attacking Kings Place the greatest possible number of kings on an 8×8 chessboard so that no two kings are placed on adjacent --- vertically, horizontally, or diagonally --- squares.

23 Bridge Crossing at Night A group of four people, who have one flashlight, need to cross a rickety bridge at night. A maximum of two people can cross the bridge at one time, and any party that crosses (either one or two people) must have the flashlight with them. The flashlight must be walked back and forth; it cannot be thrown. Person A takes 1 minute to cross the bridge, person B takes 2 minutes, person C takes 5 minutes, and person D takes 10 minutes. A pair must walk together at the rate of the slower person’s pace. Find the fastest way they can cross the bridge.

24 Transform-and-Conquer The transform-and-conquer is a well-known approach to problem solving that is based on idea of transformation. A problem is solved in two stages. –First, in the transformation stage, it is modified into another problem that, for one reason or another, is more amenable to solution. –Then, in the second, conquering stage, it is solved.

25 Guarini’s Puzzle There are four knights on the 3×3 chessboard as shown in Fig. 1; The goal is to switch the knights in the minimum number of Moves so that the white knights are at the upper corners and The black knights are at the bottom corners. No two knights can occupy the same square at the same time. Figure 1

26 Exercise 1.1: Jigsaw Puzzle Assembly A jigsaw puzzle contains 500 pieces. A “section” of the puzzle is a set of one or more pieces that have been connected to each other. A “move” consists of connecting two sections. What is the minimum number of moves in which the puzzle can be completed.

27 Exercise 1.2: Team Ordering Suppose you have the results of a completed round-robin tournament in which n teams played each other once. Assuming there were no ties, is it always possible to list the teams in a sequence so that every team won the game with the team listed immediately after it?

28 Homework Six knights. There are six knights on a 3×4 chessboard: the three white knights are at the bottom row; and the three black knights at the top row. The object is to exchange black and white knights in the fewest possible number of their moves. No two knights can occupy the same square at the same time. Represent the six knight problem as the graph problem. Solve the problem.


Download ppt "Combinatorial Optimization Lecturer Kononov Alexander Veniaminovich."

Similar presentations


Ads by Google