CSE 548: (Design And) Analysis of Algorithms Figurenetworks 3.1 (A) A— Map Communication, and (B) Its Graph

Total Page:16

File Type:pdf, Size:1020Kb

CSE 548: (Design And) Analysis of Algorithms Figurenetworks 3.1 (A) A— Map Communication, and (B) Its Graph Intro DFS Biconnectivity DAGs SCC BFS Paths and Matrices Intro DFS Biconnectivity DAGs SCC BFS Paths and Matrices Overview Overview Graphs provide a concise representation of a range problems Map coloring – more generally, resource contention problems CSE 548: (Design and) Analysis of Algorithms FigureNetworks 3.1 (a) A— map communication, and (b) its graph. trac, social, biological, ... Graphs (a) (b) 5 4 6 3 2 R. Sekar 8 7 1 9 10 12 13 11 1 / 30 2 / 30 necessary to use edges with directions on them. There can be directed edgese fromx toy (writtene=(x, y)), or fromy tox (written(y, x)), or both. A particularly enormous example of a directed graph is the graph of all links in the World Wide Web. It has a vertex for each Intro DFS Biconnectivity DAGs SCC BFS Paths and Matrices Overview Introsite DFS on Biconnectivity the Internet, DAGs and SCC a directedBFS Pathsedge and Matrices(u, v) whenever siteu has a link to sitev: in total, billions of nodes and edges! Understanding even the most basic connectivity properties of the Web is of great economic and social interest. Although the size of this problem is daunting, Definition and Representations Depth-Firstwe will soon see that a Searchlot of valuable information (DFS) about the structure of a graph can, happily, be determined in just linear time. A technique for traversing all vertices in the graph A graphG = (V; E), where V is a set of vertices, and E a set of edges. An 3.1.1 How is a graph represented? We can represent a graph by an adjacency matrix; if there aren= V verticesv , . , v , this Very versatile, forms the linchpin of many graph| algorithms| 1 n edge e of the form (v1; v2) is said to span vertices v1 and v2. The edges in a is ann n array whose(i, j)th entry is × � directed graph are directed. 1 if there is an edge fromv i tov j dfs(V; E) aij = A G0 = (V 0; E0) is called a subgraph of G if V 0 ⊆ V and E0 includes every 0 otherwise. 2 [ ] = 0 foreachFor undirectedv graphs,V do thevisited matrix isv symmetricfalse since an edge u, v can be taken in either edge in E between vertices in V . { } foreachdirection. v 2 V do The biggest convenience of this format is that the presence of a particular edge can be checkedif not invisited constant[ time,v] then with justexplore one memory(V; E access.; v) On the other hand the matrix takes Adjacency matrix Adjacency list upO(n 2) space, which is wasteful if the graph does not have very many edges. An alternative representation, with size proportional to the number of edges, is the adja- A graph (V = fv1;:::; vng; E) can be Each vertex v is associated with a explorecency list(V. ItE consistsv) of V linked lists, one per vertex. The linked list for vertexu holds the ; ; | | names of vertices to whichu has an outgoing edge—that is, verticesv for which(u, v) E. represented by an n × n matrix a, linked list consisting of all vertices u visited[v] = true ∈ 88 where aij = 1 i (vi; vj ) 2 E such that (v; u) 2 E. previsit(v) /*A placeholder for now*/ foreach (v; u) 2 E do Note that adjacency matrix uses O(n2) storage, while adjacency list uses if not visited[u] then explore(G; V; u) O(jVj + jEj) storage. Both can represent directed as well as undirected postvisit(v) /*Another placeholder*/ graphs. 3 / 30 4 / 30 Intro DFS Biconnectivity DAGs SCC BFS Paths and Matrices Intro DFS Biconnectivity DAGs SCC BFS Paths and Matrices Graphs, Mazes and DFS A graph and its DFS tree Figure 3.4 The result of explore(A) on the graph of Figure 3.2. Figure 3.2 Exploring a graph is rather like navigating a maze. A L K F D A B E H B B D G H C F IJ C G E E F G J K L I C H I A D J FigureIf a maze 3.3 Finding is represented all nodes reachable as a from graph, a particular then DFS node. of the graph amounts DFS uses O(jVj) space and O(jEj + jVj) time. procedureto an exploration explore(G, and v) mapping of the maze. Figure 3.5 Depth-first search. Input:G=(V, E) is a graph;v V ∈ procedure dfs(G) Output: visited(u) is set to true for all nodesu reachable fromv for allv V: visited(v)= true 5 / 30 ∈ 6 / 30 previsit(v) visited(v)= false for each edge(v, u) E: ∈ if not visited(u): explore(u) for allv V: ∈ postvisit(v) if not visited(v): explore(v) Intro DFS Biconnectivity DAGs SCC BFS Paths and Matrices Intro DFS Biconnectivity DAGs SCC BFS Paths and Matrices DFS and Connected Components DFS Numbering and whenever you arrive at any junction (vertex) there are a variety of passages (edges) you This loop takes a different amount of time for each vertex, so let’s consider all vertices to- Figurecan follow. 3.6 (a) A careless A 12-node choice graph. of passages (b) DFS might search lead forest. you around in circles or might cause you gether. The total work done in step 1 is thenO( V ). In step 2, over the course of the entire to overlook some accessible part of the maze. Clearly, you need to record some intermediate | | Associate post andDFS, pre eachnumbers edge x, with y E each is examined visited exactly node bytwice defining, once during explore(x) and once dur- information during exploration. 1,10 11,22 23,24 { }∈ (a) (b) ing explore(y). The overall time for step 2 is thereforeO( E ) and so the depth-first search This classic challenge has amused people for centuries.A Everybody knowsC that all youF previsit and postvisit | | has a running time ofO( V + E ), linear in the size of its input. This is as efficient as we needAB to explore a labyrinthCD is a ball of string and a piece of chalk. The chalk prevents looping, | | | | could possibly hope for, since it takes this long even just to read the adjacency list. by marking the junctions you have already visited.B The stringE 4,9 always takes12,21 D you back to the previsit(v) postvisit(v) starting place, enabling you to return to passages2,3 that you previously saw but did not yet Figure 3.6 shows the outcome of depth-first search on a 12-node graph, once again break- investigate.E F G H pre[v] = clock ing ties alphabeticallypost (ignore[v] the = pairsclock of numbers for the time being). The outer loop of DFS I 5,8 13,20 H How can we simulate these two primitives, chalk and string, on a computer? The chalk calls explore three times, onA,C, andfinallyF . As a result, there are three trees, each marks are easy: for each vertex, maintain a Boolean variable indicating whether it has been clock++ rooted at one of these startingclock++ points. Together they constitute a forest. visitedI already.JK As for the ball ofL string, the correct cyberanalogJ is a14,17 stackG. After all,L the exact 6,7 18,19 role of the string is to offer two primitive operations—unwind to get to a new junction (the 3.2.3 Connectivity in undirected graphs stack equivalent is to push the new vertex) and rewind to return to the previous junction (pop Property K the stack). An undirected graph is if there is a path between any pair of vertices. The graph 15,16 For any two vertices u and v, the intervals connected[pre[u]; post[u]] and Instead of explicitly maintaining a stack, we will do so implicitly via recursion (which of Figure 3.6 is not connected because, for instance, there is no path fromA toK. However, it is implemented using a stack of activation records). The resulting algorithm is shown in [pre[v]; post[v]] aredoes either have disjoint, three disjoint or one connected is contained regions, entirelycorresponding within to the following sets of vertices: A connected component of a graph is a maximal subgraph where 90 another. Thesethere regions is path are called between connected any components two vertices: each in of themthe subgraph, is a subgraph i.e., that it is is internally a A,B,E,I,J C,D,G,H,K,L F connected but has no edges to the remaining vertices. When explore is started at a particular { }{ }{ } vertex,maximal it identiconnectedfies precisely subgraph the connected. component containing that vertex. And each time 92 the DFS outer loop calls explore, a new connected component is picked out. 7 / 30 8 / 30 Thus depth-first search is trivially adapted to check if a graph is connected and, more generally, to assign each nodev an integer ccnum[v] identifying the connected component to which it belongs. All it takes is procedure previsit(v) ccnum[v] = cc where cc needs to be initialized to zero and to be incremented each time the DFS procedure calls explore. 3.2.4 Previsit and postvisit orderings We have seen how depth-first search—a few unassuming lines of code—is able to uncover the connectivity structure of an undirected graph in just linear time. But it is far more versatile than this. In order to stretch it further, we will collect a little more information during the ex- ploration process: for each node, we will note down the times of two important events, the mo- ment offirst discovery (corresponding to previsit) and that offinal departure (postvisit).
Recommended publications
  • 1 Vertex Connectivity 2 Edge Connectivity 3 Biconnectivity
    1 Vertex Connectivity So far we've talked about connectivity for undirected graphs and weak and strong connec- tivity for directed graphs. For undirected graphs, we're going to now somewhat generalize the concept of connectedness in terms of network robustness. Essentially, given a graph, we may want to answer the question of how many vertices or edges must be removed in order to disconnect the graph; i.e., break it up into multiple components. Formally, for a connected graph G, a set of vertices S ⊆ V (G) is a separating set if subgraph G − S has more than one component or is only a single vertex. The set S is also called a vertex separator or a vertex cut. The connectivity of G, κ(G), is the minimum size of any S ⊆ V (G) such that G − S is disconnected or has a single vertex; such an S would be called a minimum separator. We say that G is k-connected if κ(G) ≥ k. 2 Edge Connectivity We have similar concepts for edges. For a connected graph G, a set of edges F ⊆ E(G) is a disconnecting set if G − F has more than one component. If G − F has two components, F is also called an edge cut. The edge-connectivity if G, κ0(G), is the minimum size of any F ⊆ E(G) such that G − F is disconnected; such an F would be called a minimum cut.A bond is a minimal non-empty edge cut; note that a bond is not necessarily a minimum cut.
    [Show full text]
  • CLRS B.4 Graph Theory Definitions Unit 1: DFS Informally, a Graph
    CLRS B.4 Graph Theory Definitions Unit 1: DFS informally, a graph consists of “vertices” joined together by “edges,” e.g.,: example graph G0: 1 ···················•······························· ····························· ····························· ························· ···· ···· ························· ························· ···· ···· ························· ························· ···· ···· ························· ························· ···· ···· ························· ············· ···· ···· ·············· 2•···· ···· ···· ··· •· 3 ···· ···· ···· ···· ···· ··· ···· ···· ···· ···· ···· ···· ···· ···· ···· ···· ······· ······· ······· ······· ···· ···· ···· ··· ···· ···· ···· ···· ···· ··· ···· ···· ···· ···· ···· ···· ···· ···· ···· ···· ··············· ···· ···· ··············· 4•························· ···· ···· ························· • 5 ························· ···· ···· ························· ························· ···· ···· ························· ························· ···· ···· ························· ····························· ····························· ···················•································ 6 formally a graph is a pair (V, E) where V is a finite set of elements, called vertices E is a finite set of pairs of vertices, called edges if H is a graph, we can denote its vertex & edge sets as V (H) & E(H) respectively if the pairs of E are unordered, the graph is undirected if the pairs of E are ordered the graph is directed, or a digraph two vertices joined by an edge
    [Show full text]
  • Efficient Multicore Algorithms for Identifying Biconnected Components
    International Journal of Networking and Computing { www.ijnc.org ISSN 2185-2839 (print) ISSN 2185-2847 (online) Volume 6, Number 1, pages 87{106, January 2016 Efficient Multicore Algorithms For Identifying Biconnected Components1 Meher Chaitanya [email protected] and Kishore Kothapalli [email protected] International Institute of Information Technology Hyderabad, Gachibowli, India 500 032. Received: July 30, 2015 Revised: October 26, 2015 Accepted: December 1, 2015 Communicated by Akihiro Fujiwara Abstract In this paper we design and implement an algorithm for finding the biconnected components of a given graph. Our algorithm is based on experimental evidence that finding the bridges of a graph is usually easier and faster in the parallel setting. We use this property to first decompose the graph into independent and maximal 2-edge-connected subgraphs. To identify the articulation points in these 2-edge connected subgraphs, we again convert this into a problem of finding the bridges on an auxiliary graph. It is interesting to note that during the conversion process, the size of the graph may increase. However, we show that this small increase in size and the run time is offset by the consideration that finding bridges is easier in a parallel setting. We implement our algorithm on an Intel i7 980X CPU running 12 threads. We show that our algorithm is on average 2.45x faster than the best known current algorithms implemented on the same platform. Finally, we extend our approach to dense graphs by applying the sparsification technique suggested by Cong and Bader in [7]. Keywords: Biconnected components, Least common ancestor, 2-edge connected components, Articulation points 1 Introduction The biconnected components of a given graph are its maximal 2-connected subgraphs.
    [Show full text]
  • Simpler Sequential and Parallel Biconnectivity Augmentation
    Simpler Sequential and Parallel Biconnectivity Augmentation Surabhi Jain and N.Sadagopan Department of Computer Science and Engineering, Indian Institute of Information Technology, Design and Manufacturing, Kancheepuram, Chennai, India. fsurabhijain,[email protected] Abstract. For a connected graph, a vertex separator is a set of vertices whose removal creates at least two components and a minimum vertex separator is a vertex separator of least cardinality. The vertex connectivity refers to the size of a minimum vertex separator. For a connected graph G with vertex connectivity k (k ≥ 1), the connectivity augmentation refers to a set S of edges whose augmentation to G increases its vertex connectivity by one. A minimum connectivity augmentation of G is the one in which S is minimum. In this paper, we focus our attention on connectivity augmentation of trees. Towards this end, we present a new sequential algorithm for biconnectivity augmentation in trees by simplifying the algorithm reported in [7]. The simplicity is achieved with the help of edge contraction tool. This tool helps us in getting a recursive subproblem preserving all connectivity information. Subsequently, we present a parallel algorithm to obtain a minimum connectivity augmentation set in trees. Our parallel algorithm essentially follows the overall structure of sequential algorithm. Our implementation is based on CREW PRAM model with O(∆) processors, where ∆ refers to the maximum degree of a tree. We also show that our parallel algorithm is optimal whose processor-time product is O(n) where n is the number of vertices of a tree, which is an improvement over the parallel algorithm reported in [3].
    [Show full text]
  • Strongly Connected Components and Biconnected Components
    Strongly Connected Components and Biconnected Components Daniel Wisdom 27 January 2017 1 2 3 4 5 6 7 8 Figure 1: A directed graph. Credit: Crash Course Coding Companion. 1 Strongly Connected Components A strongly connected component (SCC) is a set of vertices where every vertex can reach every other vertex. In an undirected graph the SCCs are just the groups of connected vertices. We can find them using a simple DFS. This works because, in an undirected graph, u can reach v if and only if v can reach u. This is not true in a directed graph, which makes finding the SCCs harder. More on that later. 2 Kernel graph We can travel between any two nodes in the same strongly connected component. So what if we replaced each strongly connected component with a single node? This would give us what we call the kernel graph, which describes the edges between strongly connected components. Note that the kernel graph is a directed acyclic graph because any cycles would constitute an SCC, so the cycle would be compressed into a kernel. 3 1,2,5,6 4,7 8 Figure 2: Kernel graph of the above directed graph. 3 Tarjan's SCC Algorithm In a DFS traversal of the graph every SCC will be a subtree of the DFS tree. This subtree is not necessarily proper, meaning that it may be missing some branches which are their own SCCs. This means that if we can identify every node that is the root of its SCC in the DFS, we can enumerate all the SCCs.
    [Show full text]
  • Characterizing Simultaneous Embedding with Fixed Edges
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by computer science publication server Characterizing Simultaneous Embedding with Fixed Edges J. Joseph Fowler1, Michael J¨unger2, Stephen G. Kobourov1, and Michael Schulz2 1 University of Arizona, USA {jfowler,kobourov}@cs.arizona.edu ⋆ 2 University of Cologne, Germany {mjuenger,schulz}@informatik.uni-koeln.de ⋆⋆ Abstract. A set of planar graphs share a simultaneous embedding if they can be drawn on the same vertex set V in the plane without crossings between edges of the same graph. Fixed edges are common edges between graphs that share the same Jordan curve in the simultaneous drawings. While any number of planar graphs have a simultaneous embedding without fixed edges, determining which graphs always share a simultaneous embedding with fixed edges (SEFE) has been open. We partially close this problem by giving a necessary condition to determine when pairs of graphs have a SEFE. 1 Introduction In many practical applications including the visualization of large graphs and very-large-scale in- tegration (VLSI) of circuits on the same chip, edge crossings are undesirable. A single vertex set can suffice in which multiple edge sets correspond to different edge colors or circuit layers. While the union of any pair of edge sets may be nonplanar, a planar drawing of each layer may still be possible, as crossings between edges of distinct edge sets is permitted. This corresponds to the problem of simultaneous embedding (SE). Without restrictions on the types of edges used, this problem is trivial since any number of planar graphs can be drawn on the same fixed set of vertex locations [6].
    [Show full text]
  • Near-Linear Time Constant-Factor Approximation Algorithm for Branch-Decomposition of Planar Graphs
    Near-Linear Time Constant-Factor Approximation Algorithm for Branch-Decomposition of Planar Graphs1 Qian-Ping Gu and Gengchun Xu School of Computing Science, Simon Fraser University Burnaby BC Canada V5A1S6 [email protected],[email protected] Abstract: We give an algorithm which for an input planar graph G of n vertices and integer k, in min{O(n log3 n),O(nk2)} time either constructs a branch-decomposition of G k+1 with width at most (2 + δ)k, δ > 0 is a constant, or a (k + 1) × ⌈ 2 ⌉ cylinder minor of G implying bw(G) >k, bw(G) is the branchwidth of G. This is the first O˜(n) time constant- factor approximation for branchwidth/treewidth and largest grid/cylinder minors of planar graphs and improves the previous min{O(n1+ǫ),O(nk2)} (ǫ> 0 is a constant) time constant- factor approximations. For a planar graph G and k = bw(G), a branch-decomposition of g k width at most (2 + δ)k and a g × 2 cylinder/grid minor with g = β , β > 2 is constant, can be computed by our algorithm in min{O(n log3 n log k),O(nk2 log k)} time. Key words: Branch-/tree-decompositions, grid minor, planar graphs, approximation algo- rithm. 1 Introduction The notions of branchwidth and branch-decomposition introduced by Robertson and Sey- mour [31] in relation to the notions of treewidth and tree-decomposition have important algorithmic applications. The branchwidth bw(G) and the treewidth tw(G) of graph G 3 are linearly related: max{bw(G), 2} ≤ tw(G)+1 ≤ max{⌊ 2 bw(G)⌋, 2} for every G with more than one edge, and there are simple translations between branch-decompositions and tree-decompositions that meet the linear relations [31].
    [Show full text]
  • Number One Is in NC
    数理解析研究所講究録 第 790 巻 1992 年 155-161 155 Deciding whether Graph $G$ Has Page Number One is in NC 増山 繁 (豊橋技術科学大学知識情報工学系) Shigeru MASUYAMA Department of Knowledge-Based Information Engineering Toyohashi University of Technology Toyohashi 441, Japan 内藤昭三 (NTT 基礎研究所) Shozo NAITO Basic Research Laboratories NTT Musashino 180, Japan Abstract Based on a forbidden subgraph characterization of a graph to have one page, we develop a polylog time algorithm to tell if page number of given graph $G$ is one with polynomial number of processors, clarifying this problem to be in NC. 1 Introduction is crossing when they are drawn on the same side of the linear arrangement of vertices. Similar problem setting ap- This paper discusses the problem of pears in the formulation of the non- deciding whether the given graph is crossing constraint on word modifica- noncrossing, where graph $G$ is non- tion to sentence generation in natural crossing if there exists a linear arrange- language processing, which motivates ment of vertices so that no pair of edges 156 us to study this problem. are undirected and may have multiple This problem is a specialization of edges. We also assume that a path the book embedding[12] in the sense denotes a simple path throughout this that this problem asks if the given paper. CREW PRAM (see e.g., [5]) graph has page number one, i.e., a is adopted as a parallel computation graph can be embedded in a single model. page. In general, the book embedding is hard: it is NP-complete to tell if a 2 Forbidden Sub- planar graph can be embedded in two graph Characterization of a pages [3].
    [Show full text]
  • DISSERTATION GENERALIZED BOOK EMBEDDINGS Submitted By
    DISSERTATION GENERALIZED BOOK EMBEDDINGS Submitted by Shannon Brod Overbay Department of Mathematics In partial fulfillment of the requirements for the degree of Doctor of Philosophy Colorado State University Fort Collins, Colorado Summer 1998 COLORADO STATE UNIVERSITY May 13, 1998 WE HEREBY RECOMMEND THAT THE DISSERTATION PREPARED UNDER OUR SUPERVISION BY SHANNON BROD OVERBAY ENTITLED GENERALIZED BOOK EMBEDDINGS BE ACCEPTED AS FULFILLING IN PART REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSO- PHY. Committee on Graduate Work Adviser Department Head ii ABSTRACT OF DISSERTATION GENERALIZED BOOK EMBEDDINGS An n-book is formed by joining n distinct half-planes, called pages, together at a line in 3-space, called the spine. The book thickness bt(G) of a graph G is the smallest number of pages needed to embed G in a book so that the vertices lie on the spine and each edge lies on a single page in such a way that no two edges cross each other or the spine. In the first chapter, we provide background material on book embeddings of graphs and preview our results on several related problems. In the second chapter, we use a theorem of Bernhart and Kainen and a result of Whitney to present a large class of two-page embeddable planar graphs. In particular, we prove that a graph G that can be drawn in the plane so that G has no triangles other than faces can be embedded in a two-page book. The discussion of planar graphs continues in the third chapter where we define a book with a tree-spine.
    [Show full text]
  • Schematic Representation of Large Biconnected Graphs?
    Schematic Representation of Large Biconnected Graphs? Giuseppe Di Battista, Fabrizio Frati, Maurizio Patrignani, and Marco Tais Roma Tre University, Rome, Italy fgdb,frati,patrigna,[email protected] Abstract. Suppose that a biconnected graph is given, consisting of a large component plus several other smaller components, each separated from the main component by a separation pair. We investigate the existence and the computation time of schematic representations of the structure of such a graph where the main component is drawn as a disk, the vertices that take part in separation pairs are points on the boundary of the disk, and the small components are placed outside the disk and are represented as non-intersecting lunes connecting their separation pairs. We consider several drawing conventions for such schematic representations, according to different ways to account for the size of the small components. We map the problem of testing for the existence of such representations to the one of testing for the existence of suitably constrained 1-page book-embeddings and propose several polynomial-time algorithms. 1 Introduction Many of today's applications are based on large-scale networks, having billions of vertices and edges. This spurred an intense research activity devoted to finding methods for the visualization of very large graphs. Several recent contributions focus on algorithms that produce drawings where either the graph is only partially represented or it is schematically visualized. Examples of the first type are proxy drawings [6,12], where a graph that is too large to be fully visualized is represented by the drawing of a much smaller proxy graph that preserves the main features of the original graph.
    [Show full text]
  • Balanced Vertex-Orderings of Graphs
    Balanced Vertex-Orderings of Graphs Therese Biedl 1 Timothy Chan 1 School of Computer Science, University of Waterloo Waterloo, ON N2L 3G1, Canada. Yashar Ganjali 2 Department of Electrical Engineering, Stanford University Stanford, CA 94305, U.S.A. MohammadTaghi Hajiaghayi 3 Laboratory for Computer Science, Massachusetts Institute of Technology Cambridge, MA 02139, U.S.A. David R. Wood 4,∗ School of Computer Science, Carleton University Ottawa, ON K1S 5B6, Canada. Abstract In this paper we consider the problem of determining a balanced ordering of the vertices of a graph; that is, the neighbors of each vertex v are as evenly distributed to the left and right of v as possible. This problem, which has applications in graph drawing for example, is shown to be NP-hard, and remains NP-hard for bipartite simple graphs with maximum degree six. We then describe and analyze a number of methods for determining a balanced vertex-ordering, obtaining optimal orderings for directed acyclic graphs, trees, and graphs with maximum degree three. For undirected graphs, we obtain a 13/8-approximation algorithm. Finally we consider the problem of determining a balanced vertex-ordering of a bipartite graph with a fixed ordering of one bipartition. When only the imbalances of the fixed vertices count, this problem is shown to be NP-hard. On the other hand, we describe an optimal linear time algorithm when the final imbalances of all vertices count. We obtain a linear time algorithm to compute an optimal vertex-ordering of a bipartite graph with one bipartition of constant size. Key words: graph algorithm, graph drawing, vertex-ordering.
    [Show full text]
  • Pure Graph Algorithms
    Lecture IV Page 1 “Liesez Euler, liesez Euler, c’est notre maˆıtre a´ tous” (Read Euler, read Euler, he is our master in everything) — Pierre-Simon Laplace (1749–1827) Lecture IV PURE GRAPH ALGORITHMS Graph Theory is said to have originated with Euler (1707–1783). The citizens of the city1 of K¨onigsberg asked him to resolve their favorite pastime question: is it possible to traverse all the 7 bridges joining two islands in the River Pregel and the mainland, without retracing any path? See Figure 1(a) for a schematic layout of these bridges. Euler recognized2 in this problem the essence of Leibnitz’s earlier interest in founding a new kind of mathematics called “analysis situs”. This can be interpreted as topological or combinatorial analysis in modern language. A graph correspondingto the 7 bridges and their interconnections is shown in Figure 1(b). Computational graph theory has a relatively recent history. Among the earliest papers on graph algorithms are Boruvka’s (1926) and Jarn´ık (1930) minimum spanning tree algorithm, and Dijkstra’s shortest path algorithm (1959). Tarjan [7] was one of the first to systematically study the DFS algorithm and its applications. A lucid account of basic graph theory is Bondy and Murty [3]; for algorithmic treatments, see Even [5] and Sedgewick [6]. A D B C The real bridge Credit: wikipedia (a) (b) Figure 1: The 7 Bridges of Konigsberg Graphs are useful for modeling abstract mathematical relations in computer science as well as in many other disciplines. Here are some examples of graphs: Adjacency between Countries Figure 2(a) shows a political map of 7 countries.
    [Show full text]