1 / 11

MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 13, Monday, September 29

MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 13, Monday, September 29. Example 3: Pitcher Pouring Puzzle. We are given three pitchers of water, of sizes 10 quarts, 7 quarts and 4 quarts. Initially, the 10-quart is full and the other two pitchers are empty.

Download Presentation

MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 13, Monday, September 29

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. MATH 310, FALL 2003(Combinatorial Problem Solving)Lecture 13, Monday, September 29

  2. Example 3: Pitcher Pouring Puzzle • We are given three pitchers of water, of sizes 10 quarts, 7 quarts and 4 quarts. • Initially, the 10-quart is full and the other two pitchers are empty. • Is there a way to pour among pitchers to obtain exactly 2 quarts in one of the pitchers?

  3. The State Space • The state space contains the following: • S – set of states • s0 – initial state • F – final or goal states (could be only one) • P - set of rules • D – Admissibility function D:P  S  {True,False} • U – Rule application: U:P  S  S.

  4. Example 3: Pitcher Pouring Puzzle – Exercise 16(a) • We are given three pitchers of water, of sizes 8 quarts, 5 quarts and 3 quarts. • Initially, the 8-quart is full and the other two pitchers are empty. • Is there a way to pour among pitchers to obtain exactly 4 quarts in one of the pitchers?

  5. Example 3: Pitcher Pouring Puzzle – Exercise 16(a) • We are given three pitchers of water, of sizes 8 quarts, 5 quarts and 3 quarts. • Initially, the 8-quart is full and the other two pitchers are empty. • Is there a way to pour among pitchers to obtain exactly 4 quarts in one of the pitchers?

  6. State Space 800 • Here is a part of the state space for Exercise 16(a). • What is the initial state? • What are the final states? • What are the rules? • Are there any states missing? • Are there any edges missing? • Find DFS and BFS trees. 503 053 350 530 323 152 602 620 233 251 143 440 701 413 710

  7. Example 4: Jealous Wives Puzzle. • Three jealous wives and three husbands come to a river. • The boat is for two people. • Find a sequence of boat trips that will get 6 people across the river without ever letting any husband to be without his wife in the presence of another wife. A,a,B,b,C,c

  8. Example 4: Jealous Wives Puzzle. • Three jealous wives and three husbands come to a river. • The boat is for two people. • Find a sequence of boat trips that will get 6 people across the river without ever letting any husband to be without his wife in the presence of another wife. A,a,B,b,C,c

  9. A Center of a Tree T • Let T be an arbitrary tree and let r be any of its vertices. Let Tr be the tree rooted at r. Vertex r is called a center if the correspondig rooted tree Tr has minimal height. Compare Exercise 18, p. 103. 7 3 2 4 8 1 6 5

  10. 4.1. Shortest Paths • Homework (MATH 310#5M): • Read 4.2. • Do Exercises 4.1: 1,2,4,6,8,10,12 • Volunteers: • ____________ • ____________ • Problem: 1. • No Section of Chapter 4 will be on Test 1.

  11. a Labeled verticesb p q Unlabeled vertices a Dijkstra’s Algorithm • At each step of the algorithm the (green) edge e between a labeled vertex p and unlabeled vertex q is selected in such a way, that • d(p) + k(e) • is minimal.

More Related