{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture27 - Course Evaluations Deb Deppeler CS367 Lecture 1...

This preview shows pages 1–16. Sign up to view the full content.

10/13/11 1 Course Evaluations Deb Deppeler CS367 Lecture 1 Can I have a volunteer to return them to Cathy Richard? (5352 CS – fifth floor mailbox) Use #2 Pencils Please comment on: Your use of: Course Web Pages, Tutorials and Related Links My use of: PowerPoint Lecture Notes, Document Camera and Blackboard

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/13/11 2 Shortest (cheapest) path from v to z Shortest (cheapest) path: ____________________________ 3 3 1 1 4 2 1 10 5 5 3 3 1 1 2 6 3 1 1 v s a b h z g y f m d x n e
10/13/11 3 front PathNode Vertex cost prev Vertex next V weight priority queue

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/13/11 4 Adjacency Matrix (Weighted) a b c d e f g h i j k l a b c d e f g h i j k l d 1 3 1 3 10 5 2 f g e c b a
10/13/11 5 Adjacency Matrix (Weighted & Directed) a b c d e f g h i j k l a b c d e f g h i j k l 1 3 1 3 10 5 2 g d f e c b a

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/13/11 6 Cycle Detection (Undirected) static boolean hasCycle( Vertex v ) { if ( v.equals(v.getPredecessor()) ) return false; v.setMark( IN_PROGRESS ); Iterator iter = v.getAdjacent(); while ( iter.hasNext() ) { Vertex u = (Vertex) iter.getNext(); u.setPredecessor(v); int mark = u.getMark(); if ( ( mark == IN_PROGRESS ) || ( mark != DONE && hasCycle(u) ) ) { return true; } } v.setMark( DONE ); return false; }
10/13/11 7 Cycle Detection Algorithm 3 3 1 1 4 2 1 10 5 5 3 3 1 1 2 6 3 1 1 v s a b h z g y f m d x n e

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/13/11 8 Announcements Announcements Handout TODAY ! A4: Due Tomorrow (Fri) 11:59pm H3: Due next Tuesday (in class)
10/13/11 9 Last Lecture Last Lecture Directed Graphs Weighted Graphs Traversals Shortest Path

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/13/11 10 This Lecture This Lecture Graphs Implementation Adjacency List Adjacency Matrix Cycle Detection Spanning Trees
10/13/11 11 Topological Order Topological Order Assign numbers to nodes such that: for every edge Vx->Vy,  Vx's no. < Vy's no. Impossible, if there  are cycles. 764 564 354 367 302 752 552 352 764 367 354 552 302 564 752 352 8 7 6 5 4 3 2 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/13/11 12 Topological Order Topological Order Multiple assigments are possible 764 367 354 552 302 564 752 352
10/13/11 13 Topological Algorithm Topological Algorithm If no cycles, can find node with no  outgoing edges: assign last number to it For any node with all sucessors assigned,   can assign the next to last number. 764 367 354 552 302 564 752 352 764 367 354 552 302 564 752 352 8 7 6 5 4 3 2 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/13/11 14 Graph ADT Graph ADT int vertices() int edges() boolean edgeExists( Vertex, Vertex) void addEdge(Vertex,Vertex) removeEdge(Vertex, Vertex) degree(Vertex)
10/13/11 15

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 45

Lecture27 - Course Evaluations Deb Deppeler CS367 Lecture 1...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online