Problem solving by search

Similar documents
CS 241 Analysis of Algorithms

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

Constructive Geometric Constraint Solving

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

CS 461, Lecture 17. Today s Outline. Example Run

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms

COMP108 Algorithmic Foundations

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1.

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths.

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

Planar Upward Drawings

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem)

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs

ECE 407 Computer Aided Design for Electronic Systems. Circuit Modeling and Basic Graph Concepts/Algorithms. Instructor: Maria K. Michael.

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph

1 Introduction to Modulo 7 Arithmetic

QUESTIONS BEGIN HERE!

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

COMPLEXITY OF COUNTING PLANAR TILINGS BY TWO BARS

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura

Outline. Binary Tree

Similarity Search. The Binary Branch Distance. Nikolaus Augsten.

Lecture 20: Minimum Spanning Trees (CLRS 23)

12. Traffic engineering

CS September 2018

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals

Present state Next state Q + M N

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

QUESTIONS BEGIN HERE!

Section 3: Antiderivatives of Formulas

Minimum Spanning Trees

Nefertiti. Echoes of. Regal components evoke visions of the past MULTIPLE STITCHES. designed by Helena Tang-Lim

Seven-Segment Display Driver

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

Section 10.4 Connectivity (up to paths and isomorphism, not including)

EE1000 Project 4 Digital Volt Meter

Greedy Algorithms, Activity Selection, Minimum Spanning Trees Scribes: Logan Short (2015), Virginia Date: May 18, 2016

XML and Databases. Outline. Recall: Top-Down Evaluation of Simple Paths. Recall: Top-Down Evaluation of Simple Paths. Sebastian Maneth NICTA and UNSW

CS 188: Artificial Intelligence Spring Announcements

Outline. CSE 473: Artificial Intelligence Spring Types of Agents

GREEDY TECHNIQUE. Greedy method vs. Dynamic programming method:

N=4 L=4. Our first non-linear data structure! A graph G consists of two sets G = {V, E} A set of V vertices, or nodes f

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem)

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

S i m p l i f y i n g A l g e b r a SIMPLIFYING ALGEBRA.

Announcements. Not graphs. These are Graphs. Applications of Graphs. Graph Definitions. Graphs & Graph Algorithms. A6 released today: Risk

Weighted Graphs. Weighted graphs may be either directed or undirected.

The Plan. Honey, I Shrunk the Data. Why Compress. Data Compression Concepts. Braille Example. Braille. x y xˆ

CS 103 BFS Alorithm. Mark Redekopp

Depth First Search. Yufei Tao. Department of Computer Science and Engineering Chinese University of Hong Kong

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018

Organization. Dominators. Control-flow graphs 8/30/2010. Dominators, control-dependence. Dominator relation of CFGs

Designing A Concrete Arch Bridge

Uninformed Search Lecture 4

Last time: introduced our first computational model the DFA.

A 4-state solution to the Firing Squad Synchronization Problem based on hybrid rule 60 and 102 cellular automata

Walk Like a Mathematician Learning Task:

Decimals DECIMALS.

Register Allocation. Register Allocation. Principle Phases. Principle Phases. Example: Build. Spills 11/14/2012

Module 2 Motion Instructions

Kernels. ffl A kernel K is a function of two objects, for example, two sentence/tree pairs (x1; y1) and (x2; y2)

CS 188: Artificial Intelligence Fall Announcements

CS 188: Artificial Intelligence

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

0.1. Exercise 1: the distances between four points in a graph

Announcements. These are Graphs. This is not a Graph. Graph Definitions. Applications of Graphs. Graphs & Graph Algorithms

Garnir Polynomial and their Properties

CS 188: Artificial Intelligence Spring 2007

Register Allocation. How to assign variables to finitely many registers? What to do when it can t be done? How to do so efficiently?

Today. CS 232: Ar)ficial Intelligence. Search. Agents that Plan. September 3 rd, 2015 Search Problems. Uninformed Search Methods

Announcements. CS 188: Artificial Intelligence Fall Today. Reflex Agents. Goal Based Agents. Search Problems

CSI35 Chapter 11 Review

(a) v 1. v a. v i. v s. (b)

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Announcements. CS 188: Artificial Intelligence Fall Reflex Agents. Today. Goal Based Agents. Search Problems

Graph Search (6A) Young Won Lim 5/18/18

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata

A Simple Code Generator. Code generation Algorithm. Register and Address Descriptors. Example 3/31/2008. Code Generation

Multipoint Alternate Marking method for passive and hybrid performance monitoring

More Foundations. Undirected Graphs. Degree. A Theorem. Graphs, Products, & Relations

Transcription:

Prolm solving y srh Tomáš voo Dprtmnt o Cyrntis, Vision or Roots n Autonomous ystms Mrh 5, 208 / 3

Outlin rh prolm. tt sp grphs. rh trs. trtgis, whih tr rnhs to hoos? trtgy/algorithm proprtis? Progrmming instrstrutur 2 / 3

Exmpl: Romni Or 7 Nmt 75 Zrin 87 5 Isi Ar 40 iiu 99 Fgrs 92 8 80 Timisor Rimniu Vil 42 Lugoj Pitsti 2 97 70 98 Mhi 46 0 85 Urzini 75 38 Buhrst Dort 20 90 Criov iurgiu Vslui Hirsov 86 Eori 3 / 3

Exmpl: Romni ol: in Buhrst Prolm ormultion: stts: position in ity (itis) tions: riv twn itis olution: qun o itis (pth) Or 7 Nmt Zrin 87 75 5 Isi Ar 40 92 iiu 99 Fgrs 8 Vslui 80 Timisor Rimniu Vil 42 Lugoj Pitsti 2 97 70 98 Hirsov Mhi 46 0 85 Urzini 75 38 86 Buhrst Dort 20 90 Criov Eori iurgiu 4 / 3

Exmpl: Th 8-puzzl 7 2 4 5 2 3 5 6 4 5 6 8 3 7 8 stts? tions? solution? ost? trt tt ol tt 5 / 3

Exmpl: Vuum lnr L R L R L R R L R R L L L R L R stts? tions? solution? ost? 6 / 3

A rh Prolm tt sp (inluing trt/initil stt): position, or onigurtion, Ations: riv to, Up, Down, Lt... Trnsition mol: ivn stt n tion rturn stt (n ost) ol tst: Ar w on? 7 / 3

tt p rphs tt sp grph: srh prolm Nos r strt worl onigurtions Ars rprsnt tion rsults rprsnttion o ol tst is st o gol nos Eh stt ours only on in stt (srh) sp. 8 / 3

rh Trs Hr w strt Possil uturs A wht i tr o plns n thir outoms trt no is th root Chilrn r sussors Nos show stts, ut orrspon to plns tht hiv thos stts Wht os th lst itm mn, tully? 9 / 3

tt p rphs vs. rh Trs How ig is th srh tr? 0 / 3

rh tr or Romni () Th initil stt Ar iiu Timisor Zrin Ar Fgrs Or Rimniu Vil Ar Lugoj Ar Or () Atr xpning Ar Ar iiu Timisor Zrin Ar Fgrs Or Rimniu Vil Ar Lugoj Ar Or () Atr xpning iiu Ar iiu Timisor Zrin Ar Fgrs Or Rimniu Vil Ar Lugoj Ar Or / 3

rh lmnts iiu Timisor Zrin Ar Fgrs Or Rimniu Vil Ar Lugoj Ar Or () Atr xpning iiu Ar iiu Timisor Zrin Ar Fgrs Or Rimniu Vil Ar Lugoj Ar Or Expn plns - possil wys (tr nos). Mng/Mintn ring (or rontir) o plns unr onsirtion. Expn nw nos wisly(?). 2 / 3

iiu Zrin Rimniu Vil Tr srh lgorithmar Ar Fgrs Or Lugoj Ar Or () Atr xpning iiu Ar iiu Timisor Zrin Ar Fgrs Or Rimniu Vil Ar Lugoj Ar Or untion tr srh(prolm) rturn solution or ilur initiliz y using th initil stt o th prolm loop i no nits or xpnsion thn rturn ilur ls hoos l no or xpnsion n i i th no ontins gol stt thn rturn th solution n i Expn th no n th rsulting nos to th tr n loop n untion 3 / 3

Exmpl o tr srh Whih nos to xplor? Wht r th proprtis o strtgy/lgorithm? 4 / 3

rh (lgorithm) proprtis Complt? urnt to in solution (i xists)? Optiml? urnt to in th lst ost pth? Tim omplxity? How mny stps - n oprtion with no? p omplxity? How mny nos to rmmr? How mny nos in tr? Wht r tr prmtrs? 5 / 3

Dpth-First rh (DF) Wht r th DF proprtis? 6 / 3

DF proprtis Complt? Optiml? Tim omplxity? p omplxity? 7 / 3

Brth-First rh (BF) Wht r th BF proprtis? 8 / 3

BF proprtis Complt? Optiml? Tim omplxity? p omplxity? 9 / 3

DF vs BF 20 / 3

DF with limit pth, mxpth=2 Do not ollow nos with pth > mxpth 2 / 3

Itrtiv pning DF (ID-DF) trt with mxpth = Prorm DF with limit pth. Rport suss or ilur. I ilur, orgt vrything, inrs mxpth n rpt DF Is it not trril wst to orgt vrything twn stps? 22 / 3

Cost snsitiv srh 3.5,0 2,,2,2,,2,2,,2 In BF, DF, no ±pth ws th no-vlu. How ws th pth tully omput? How to vlut nos with pth ost? 23 / 3

Uniorm Cost rh (UC).5,0 2,,,3 3,2,2.5,2,2,3,4,3 Whn to hk th gol (n stop) th srh? Whn visiting or xpning th no? 24 / 3

Whn to stop, whn visiting or xpning?.5,0 2,,,3.2 3 0.5,2,2.5,2.2,2,3,4,3,2.7,3 25 / 3

iorm#cost#r Exmpl: rph with osts 3 2 p 5 8 9 2 h 8 2 q r 2 26 / 3

UC proprtis 27 / 3

Progrmming Tr rh 28 / 3

Inrstrutur or (tr) srh lgorithms Wht shoul tr no n now? n.stt n.prnt n.pthost Prhps w my somthing ltr, i n... 29 / 3

How to orgniz nos? Th Python xmpls r just suggstions,... A ynmilly link strutur (list()). A no (list.insrt(no)). Tk no n rmov rom th strutur (no=list.pop()). Chk th Python mouls hpq n quu 2 or inspirtion. https://os.python.org/3.5/lirry/hpq.html 2 https://os.python.org/3.5/lirry/quu.html 30 / 3

Wht is th solution? W stop whn ol is rh. How o w ontrut th pth? 3 / 3