540 likes | 821 Vues
How many faces do you get from walking the faces of this rotation system of K 4 ? Is this an embedding of K 4 in the plane? 0 : 1 3 2 1 : 0 3 2 2 : 0 3 1 3 : 0 2 1. Rotation Systems. G connected on an orientable surface: g= (2 – n + m – f)/2. 0 plane torus 2.
E N D
How many faces do you get from walking the faces of this rotation system of K4? Is this an embedding of K4 in the plane? 0 : 1 3 2 1 : 0 3 2 2 : 0 3 1 3 : 0 2 1
Rotation Systems G connected on an orientable surface: g= (2 – n + m – f)/2 • 0 plane • torus • 2 F0: (a, b)(b, c)(c, a)(a, b) F1: (a, d)(d, e)(e, b)(b, a)(a, d) Greg McShane
How can we find a rotation system that represents a planar embedding of a graph? Input graph: 0: 1 3 4 1: 0 2 4 2: 1 3 3: 0 2 4 4: 0 1 3 Planar embedding 0: 1 4 3 1: 0 2 4 2: 1 3 3: 0 4 2 4: 0 1 3
f= number of faces n= number of vertices m= number of edges Euler’s formula: For any connected planar graph G, f= m-n+2. Proof by induction: How many edges must a connected graph on n vertices have?
Euler’s formula: For any connected planar graph G, f= m-n+2. [Basis] The connected graphs on n vertices with a minimum number of edges are trees. If T is a tree, then it has n-1 edges and one face when embedded in the plane. Checking the formula: 1 = (n-1) – n + 2 ⟹ 1 = 1 so the base case holds.
[Induction step (m m+1)] Assume that for a planar embedding of a connected planar graph G with n vertices and m edges that f= m-n+2. We want to prove that adding one edge (while maintaining planarity) gives a new planar embedding of a graph H such that f’ (the number of faces of H) satisfies f’ = m’ – n + 2 where m’= m+1 is the number of edges of H.
Adding one edge adds one more face. Therefore, f’ = f+ 1. Recall m’= m+1. Checking the formula: f’ = m’ – n + 2 means that f+1 = m+1 – n + 2 subtracting one from both sides gives f= m – n + 2 which we know is true by induction.
Pre-processing for an embedding algorithm. Break graph into its connected components. For each connected component, break it into its 2-connected components (maximal subgraphs having no cut vertex).
A disconnected graph: isolated vertex
How do we decompose the graph like this using a computer algorithm? The easiest way: BFS (Breadth First Search)
Queue (used for BFS) http://devcentral.f5.com/weblogs/images/devcentral_f5_com/weblogs/Joe/WindowsLiveWriter/PowerShellABCsQisforQueues_919A/queue_2.jpg http://www.ac-nancy-metz.fr/enseign/anglais/Henry/bus-queue.jpg
Queue data structure: Items are: Added to the rear of the queue. Removed from the front of the queue. http://cs.wellesley.edu/~cs230/assignments/lab12/queue.jpg
If you have an upper bound on the lifetime size of the queue then you can use an array: qfront=5, qrear=9 (qrear is next empty spot in array)
qfront=5, qrear=9 Q: To test if there is something in the queue: if (qfront < qrear) To add x to the queue: Q[qrear]= x; qrear++; To delete front element of the queue: x= Q[qfront]; qfront++;
If the neighbours of each vertex are ordered according to their vertex numbers, in what order does a BFS starting at 0 visit the vertices?
BFS starting at a vertex s using an array for the queue: Data structures: A queue Q[0..(n-1)] of vertices, qfront, qrear. parent[i]= BFS tree parent of node i. The parent of the root s is s. To initialize: // Set parent of each node to be -1 to indicate // that the vertex has not yet been visited. for (i=0; i < n; i++) parent[i]= -1; // Initialize the queue so that BFS starts at s qfront=0; qrear=1; Q[qfront]= s; parent[s]=s;
while (qfront < qrear) // Q is not empty u= Q[qfront]; qfront++; for each neighbour v of u if (parent[v] == -1) // not visited parent[v]= u; Q[qrear]= v; qrear++; end if end for end while
BFI[v]= Breadth first index of v = step at which v is visited. The BFI[v] is equal to v’s position in the queue.
To initialize: // Set parent of each node to be -1 to indicate // that the vertex has not yet been visited. for (i=0; i < n; i++) parent[i]= -1; // Initialize the queue so that BFS starts at s qfront=0; qrear=1; Q[qfront]= s; parent[s]=s; BFI[s]= 0;
while (qfront < qrear) // Q is not empty u= Q[qfront]; qfront++; for each neighbour v of u if (parent[v] == -1) // not visited parent[v]= u; BFI[v]= qrear; Q[qrear]= v; qrear++; end if end for end while
One application: How many connected components does a graph have and which vertices are in each component?
To find the connected components: for (i=0; i < n; i++) parent[i]= -1; nComp= 0; for (i=0; i < n; i++) if (parent[i] == -1) nComp++; BFS(i, parent, component, nComp);
BFS(s, parent, component, nComp) // Do not initialize parent. // Initialize the queue so that BFS starts at s qfront=0; qrear=1; Q[qfront]= s; parent[s]=s; component[s]= nComp;
while (qfront < qrear) // Q is not empty u= Q[qfront]; qfront++; for each neighbour v of u if (parent[v] == -1) // not visited parent[v]= u; component[v]= nComp; Q[qrear]= v; qrear++; end if end for end while
How much time does BFS take to indentify the connected components of a graph when the data structure used for a graph is an adjacency matrix?
How much time does BFS take to indentify the connected components of a graph when the data structure used for a graph is an adjacency list?
How could you modify BFS to determine if v is a cut vertex? .
A bridge with respect to a subgraph H of a graph G is either: • An edge e=(u, v) which is not in H but both u and v are in H. • A connected component C of G-H plus any edges that are incident to one vertex in C and one vertex in H plus the endpoints of these edges. • How can you find the bridges with respect to a cut vertex v?
How can we find a planar embedding of each 2-connected component of a graph? One simple solution: Algorithm by Demoucron, Malgrange and Pertuiset. @ARTICLE{genus:DMP, AUTHOR = {G. Demoucron and Y. Malgrange and R. Pertuiset}, TITLE = {GraphesPlanaires}, JOURNAL = {Rev. Fran\c{c}aiseRecherche Op\'{e}rationnelle}, YEAR = {1964}, VOLUME = {8}, PAGES = {33--47} }
A bridge can be drawn in a face if all its points of attachment lie on that face.
Demoucron, Malgrange and Pertuiset ’64: 1. Find a bridge which can be drawn in a minimum number of faces (the blue bridge).
2. Find a path between two points of attachment for that bridge and add the path to the embedding.
Gibbons: if G is 2-vertex connected, every bridge of G has at least two points of contact and can therefore be drawn in just two faces. Counterexample:
Graphs homeomorphic to K5 and K3,3: Rashid Bin Muhammad
Kuratowski’s theorem: If G is not planar then it contains a subgraph homeomorphic to K5 or K3,3. Topological obstruction for surface S: degrees ≥3,does not embed on S, G-e embeds on S for all e.