gr.anim

# gr.anim - gr0 GRAPHS Hanan Samet Computer Science...

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

gr0 Copyright © 1997 Hanan Samet These notes may not be reproduced by any means (mechanical or elec- tronic or any other) without the express written permission of Hanan Samet GRAPHS Hanan Samet Computer Science Department and Center for Automation Research and Institute for Advanced Computer Studies University of Maryland College Park, Maryland 20742 e-mail: [email protected]

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

View Full Document
gr1 GRAPH (G) • Generalization of a tree 1. no longer a distinguished node called the root • implies no need to distinguish between leaf and nonleaf nodes 2. two nodes can be linked by more than one sequence of edges • Formally: set of vertices (V) and edges (E) joining them, with at most one edge joining any pair of vertices • (V 0 , V 1 , …, V ): path of length n from V 0 to V (chain) • Simple Path: distinct vertices (elementary chain) • Connected: path between any two vertices of G • Cycle: simple path of length 3 from V 0 to V 0 (length in terms of edges) • Planar: curves intersect only at points of graph • Degree: number of edges intersecting at the node • Isomorphic: if there is a one-to-one correspondence between nodes and edges of two graphs A B C D E A B C D n n Copyright © 1998 by Hanan Samet
gr2 SAMPLE GRAPH PROBLEM • Given n people at a party who shake hands, show that at the party’s end, an even number of people have shaken hands with an odd number of people • Theorem: For any graph G an even number of nodes have an odd degree • Proof: 1. each edge joins 2 nodes 2. each edge contributes 2 to the sum of degrees 3. sum of degrees is even 4. thus an even number of nodes with odd degree Copyright © 1998 by Hanan Samet

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

View Full Document
gr3 FREE TREES • Connected graph with no cycles • Given G as a free tree with n vertices 1. Connected, but not so if any edge is removed 2. One simple path from V to V´ ( V V´ ) 3. No cycles and n – 1 edges 4. G is connected with n – 1 edges • Differences from regular trees: 1. No identification of root 2. No distinction between terminal and branch nodes A B C D E F G Copyright © 1998 by Hanan Samet
gr4 1 b FREE SUBTREES • Definition: set of edges such that all the vertices of the graph are connected to form a free tree • Ex: distribution of telephone networks London C pl C lr C ln Paris C pr Rio de Janeiro C nr New York C pb C br C bn Buenos Aires Copyright © 1998 by Hanan Samet

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

View Full Document
gr4 1 b FREE SUBTREES • Definition: set of edges such that all the vertices of the graph are connected to form a free tree • Ex: distribution of telephone networks London C pl C lr C ln Paris C pr Rio de Janeiro C nr New York C pb C br C bn Buenos Aires Copyright © 1998 by Hanan Samet 2 r • Free subtree
gr4 1 b FREE SUBTREES • Definition: set of edges such that all the vertices of the graph are connected to form a free tree • Ex: distribution of telephone networks London C pl C lr C ln Paris C pr Rio de Janeiro C nr New York C pb C br C bn Buenos Aires Copyright © 1998 by Hanan Samet 2 r • Free subtree 3 z • Given: connected graph G n nodes (5) m edges (8) • Cyclomatic Number

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 ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern