maze running in c minor

84
Maze Running in C Minor A Series of Slides in 5 Parts Movement 3. IDFS

Upload: reya

Post on 19-Mar-2016

41 views

Category:

Documents


0 download

DESCRIPTION

Maze Running in C Minor. A Series of Slides in 5 Parts Movement 3. IDFS. MAX DEPTH: 1 AT:AA. STACK:AB. KEY: GREEN – Start RED – Exit YELLOW – Visited on this iteration. Nodes are taken in the order: UP, LEFT, DOWN, RIGHT. MAX DEPTH: 1 AT:AB. STACK:. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Maze Running in C Minor

Maze Running in C Minor

A Series of Slides in 5 PartsMovement 3. IDFS

Page 2: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 1AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 3: Maze Running in C Minor

A B C D EA SBCD E

STACK:

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 1AT: AB

Note that since we are at depth 1, we do not push any neighbors of AB onto the stack.

Page 4: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 2AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 5: Maze Running in C Minor

A B C D EA SBCD E

STACK: BBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 2AT: AB

Note that we push all neighbors except for the node we just came from.

Page 6: Maze Running in C Minor

A B C D EA SBCD E

STACK: AC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 2AT: BB

Page 7: Maze Running in C Minor

A B C D EA SBCD E

STACK:

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 2AT: AC

Page 8: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 3AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 9: Maze Running in C Minor

A B C D EA SBCD E

STACK: BBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 3AT: AB

Page 10: Maze Running in C Minor

A B C D EA SBCD E

STACK: CBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 3AT: BB

Page 11: Maze Running in C Minor

A B C D EA SBCD E

STACK: BAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 3AT: CB

Page 12: Maze Running in C Minor

A B C D EA SBCD E

STACK: AC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 3AT: BA

Page 13: Maze Running in C Minor

A B C D EA SBCD E

STACK:

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 3AT: AC

Page 14: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 4AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 15: Maze Running in C Minor

A B C D EA SBCD E

STACK: BBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 4AT: AB

Page 16: Maze Running in C Minor

A B C D EA SBCD E

STACK: CBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 4AT: BB

Page 17: Maze Running in C Minor

A B C D EA SBCD E

STACK: DBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 4AT: CB

Page 18: Maze Running in C Minor

A B C D EA SBCD E

STACK: BAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 4AT: DB

Page 19: Maze Running in C Minor

A B C D EA SBCD E

STACK: CAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 4AT: BA

Page 20: Maze Running in C Minor

A B C D EA SBCD E

STACK: AC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 4AT: CA

Page 21: Maze Running in C Minor

A B C D EA SBCD E

STACK:

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 4AT: AC

Page 22: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 5AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 23: Maze Running in C Minor

A B C D EA SBCD E

STACK: BBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: AB

Page 24: Maze Running in C Minor

A B C D EA SBCD E

STACK: CBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: BB

Page 25: Maze Running in C Minor

A B C D EA SBCD E

STACK: DBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: CB

Page 26: Maze Running in C Minor

A B C D EA SBCD E

STACK: DEDCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: DB

Page 27: Maze Running in C Minor

A B C D EA SBCD E

STACK: DCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: DE

Page 28: Maze Running in C Minor

A B C D EA SBCD E

STACK: DABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: DC

Page 29: Maze Running in C Minor

A B C D EA SBCD E

STACK: BAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: DA

Page 30: Maze Running in C Minor

A B C D EA SBCD E

STACK: CAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: BA

Page 31: Maze Running in C Minor

A B C D EA SBCD E

STACK: DAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: CA

Note that we push DA onto the stack even though we’ve already been there. This is an implementation of IDFS where no visit information is kept.

Page 32: Maze Running in C Minor

A B C D EA SBCD E

STACK: AC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: DA

Page 33: Maze Running in C Minor

A B C D EA SBCD E

STACK:

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 5AT: AC

Page 34: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 6AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 35: Maze Running in C Minor

A B C D EA SBCD E

STACK: BBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: AB

Page 36: Maze Running in C Minor

A B C D EA SBCD E

STACK: CBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: BB

Page 37: Maze Running in C Minor

A B C D EA SBCD E

STACK: DBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: CB

Page 38: Maze Running in C Minor

A B C D EA SBCD E

STACK: DEDCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: DB

Page 39: Maze Running in C Minor

A B C D EA SBCD E

STACK: ECEADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: DE

Page 40: Maze Running in C Minor

A B C D EA SBCD E

STACK: EADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: EC

Page 41: Maze Running in C Minor

A B C D EA SBCD E

STACK: DCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: EA

Page 42: Maze Running in C Minor

A B C D EA SBCD E

STACK: CCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: DC

Page 43: Maze Running in C Minor

A B C D EA SBCD E

STACK: DABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: CC

Page 44: Maze Running in C Minor

A B C D EA SBCD E

STACK: CCBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: DA

Page 45: Maze Running in C Minor

A B C D EA SBCD E

STACK: BAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: CC

Page 46: Maze Running in C Minor

A B C D EA SBCD E

STACK: CAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: BA

Page 47: Maze Running in C Minor

A B C D EA SBCD E

STACK: DAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: CA

Page 48: Maze Running in C Minor

A B C D EA SBCD E

STACK: DBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: DA

Page 49: Maze Running in C Minor

A B C D EA SBCD E

STACK: AC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: DB

Page 50: Maze Running in C Minor

A B C D EA SBCD E

STACK:

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: AC

Page 51: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 7AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 52: Maze Running in C Minor

A B C D EA SBCD E

STACK: BBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: AB

Page 53: Maze Running in C Minor

A B C D EA SBCD E

STACK: CBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: BB

Page 54: Maze Running in C Minor

A B C D EA SBCD E

STACK: DBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: CB

Page 55: Maze Running in C Minor

A B C D EA SBCD E

STACK: DEDCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DB

Page 56: Maze Running in C Minor

A B C D EA SBCD E

STACK: ECEADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DE

Page 57: Maze Running in C Minor

A B C D EA SBCD E

STACK: EDEADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: EC

Page 58: Maze Running in C Minor

A B C D EA SBCD E

STACK: EADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: ED

Page 59: Maze Running in C Minor

A B C D EA SBCD E

STACK: DCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: EA

Page 60: Maze Running in C Minor

A B C D EA SBCD E

STACK: CCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DC

Page 61: Maze Running in C Minor

A B C D EA SBCD E

STACK: CDBCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: CC

Page 62: Maze Running in C Minor

A B C D EA SBCD E

STACK: BCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: CD

Page 63: Maze Running in C Minor

A B C D EA SBCD E

STACK: DABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: BC

Page 64: Maze Running in C Minor

A B C D EA SBCD E

STACK: CCBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DA

Page 65: Maze Running in C Minor

A B C D EA SBCD E

STACK: BABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: CC

This is a rather comical situation.

Page 66: Maze Running in C Minor

A B C D EA SBCD E

STACK: BAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: BA

Page 67: Maze Running in C Minor

A B C D EA SBCD E

STACK: CAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: BA

Page 68: Maze Running in C Minor

A B C D EA SBCD E

STACK: DAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: CA

Page 69: Maze Running in C Minor

A B C D EA SBCD E

STACK: DBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DA

Page 70: Maze Running in C Minor

A B C D EA SBCD E

STACK: EBDCCBDAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DB

Page 71: Maze Running in C Minor

A B C D EA SBCD E

STACK: DCCBDAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: EB

Page 72: Maze Running in C Minor

A B C D EA SBCD E

STACK: CBDAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DC

Page 73: Maze Running in C Minor

A B C D EA SBCD E

STACK: DAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: CB

Page 74: Maze Running in C Minor

A B C D EA SBCD E

STACK: AC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 7AT: DA

Page 75: Maze Running in C Minor

A B C D EA SBCD E

STACK:

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 6AT: AC

Page 76: Maze Running in C Minor

A B C D EA SBCD E

MAX DEPTH: 8AT: AASTACK: AB

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

Page 77: Maze Running in C Minor

A B C D EA SBCD E

STACK: BBAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: AB

Page 78: Maze Running in C Minor

A B C D EA SBCD E

STACK: CBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: BB

Page 79: Maze Running in C Minor

A B C D EA SBCD E

STACK: DBBAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: CB

Page 80: Maze Running in C Minor

A B C D EA SBCD E

STACK: DEDCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: DB

Page 81: Maze Running in C Minor

A B C D EA SBCD E

STACK: ECEADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: DE

Page 82: Maze Running in C Minor

A B C D EA SBCD E

STACK: EDEADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: EC

Page 83: Maze Running in C Minor

A B C D EA SBCD E

STACK: DDEADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: ED

Page 84: Maze Running in C Minor

A B C D EA SBCD E

STACK: EADCDABAAC

KEY: GREEN – StartRED – Exit YELLOW – Visited on this iteration

Nodes are taken in the order: UP, LEFT, DOWN, RIGHT

MAX DEPTH: 8AT: DD