Hamiltonian Circuits in Chordal Graphs William Carter Mathematics and Computer Science MSc 2010/2011

Size: px
Start display at page:

Download "Hamiltonian Circuits in Chordal Graphs William Carter Mathematics and Computer Science MSc 2010/2011"

Transcription

1 Hamiltonian Circuits in Chordal Graphs William Carter Mathematics and Computer Science MSc 2010/2011 The candidate confirms that the work submitted is their own and the appropriate credit has been given where reference has been made to the work of others. I understand that failure to attribute material which is obtained from another source may be considered as plagiarism. (Signature of student) 1

2 Summary It is my aim in this paper to find a polynomial-time algorithm to find Hamiltonian circuits in the graph class of chordal graphs. This has been done for interval graphs by Keil in 1984 [6], a graph class properly contained in the chordal graphs, but has not yet been generalised to the latter. Providing such an algorithm would reduce the gap of NP-Completeness of the Hamiltonian circuit problem. The leafage l(g) of a chordal graph G is the minimum number of leaves in an intersection representation as a family of subtrees of a tree. In this paper, an algorithm to calculate the leafage [5] is used in conjunction with the aforementioned algorithm to calculate Hamiltonian circuits in interval graphs [6], in order to work towards producing an algorithm for calculating Hamiltonian circuits in chordal graphs. It is found that the problem branches out into hundreds of different sub-cases, and so no complete algorithm could be obtained within the project time limit. However, an algorithm that works on graphs of leafage less than four is described, and possible ways to generalise this algorithm to graphs of higher leafage are outlined. i

3 Contents 1 Introduction Basic Graph Theoretic Definitions Chordal Graphs Hamiltonian Circuits in Interval Graphs The Leafage of Chordal Graphs Overloading Separators and Forced Paths Overloading Separators Forced Paths A Case Analysis Three Forced Paths Two Forced Paths Two conductors already met One conductor already met No conductors already met One Forced Path , 1-0 or or No Forced Paths and a Potential Problem Evaluation Evaluation of the Current Algorithm Generalising the Algorithm to All Chordal Graphs Reducing the Number of Searches in the Case of Zero Forced Paths Allowing Paths Between Two Central Cliques Allowing central Cliques of Higher Degree Implementations Methodologies Used A A Reflection on the Project Experience 27 B Interim Report 28 C Implementations 28 C.1 The Advanced Set Data-type C.2 Chordality Test C.3 Habib and Stacho s Leafage Algorithm C.4 Keil s Algorithm to Check Hamiltonicity in Interval Graphs ii

4 1 Introduction Hamiltonian circuits are credited by namesake to Sir William Rowan Hamilton, who in 1865 devised a game where players have to traverse all twenty vertices of a flattened dodecahedron and return to the starting vertex, without visiting any intermediate vertex twice. The vertices represented the twenty most important cities of the time and the idea was to travel the world. The problem of finding Hamiltonian circuits (see section 1.3 for a more formal definition) in graphs still retains much of its game-like nature but now holds much prestige in many areas of the academic world as well. Karp proved it NP-complete in Reducibility among Combinatorial Problems [7] and thus it carries much significance in the P vs NP problem. An efficient algorithm to calculate whether any arbitrary graph is Hamiltonian would, indirectly, prove P = NP and earn the author one million dollars for their effort, courtesy of the Clay Mathematics Institute. It is the aim of this paper to solve the problem for a specific type of graph, the chordal graphs (see 1.2). This is done by searching for an efficient algorithm to calculate Hamiltonian circuits in these graphs only, outputting a negative result if and only if there is no Hamiltonian circuit. Finding such an algorithm would close the gap of NP-completeness on the Hamiltonian circuit problem for all graphs. I shall start this task by providing the basic definitions in the field of graph theory. 1.1 Basic Graph Theoretic Definitions A graph consists of a finite set of vertices V and an irreflexive binary relation E called the edges. This paper primarily focuses on undirected graphs which are graphs whose relation E is symmetric. Let v and w be vertices of a graph G. They are adjacent if E(v, w), i.e. there is an edge between them. This can also be written vw is an edge of G. The adjacency set Adj(v) is the set of all vertices adjacent to v. The degree of v, denoted deg(v), is the number of vertices in the adjacency set. A graph is complete if Adj(v) = V \{v for every vertex v in G. Let G be a graph with vertex set V and edge set E. A graph G with vertex set V and edge set E is a subgraph of G if V V or E E. It is a proper subgraph if either V V or E E. Let S be a proper subset of V. The subgraph induced by S is the subgraph with vertex set S and with edges uv if and only if uv is an edge in G. G\S denotes the subgraph induced by the set of vertices V not also appearing in S. 1.2 Chordal Graphs I now go on to describe the graph class of chordal graphs and an algorithm to recognise such graphs. It is seen very quickly that this algorithm is an integral part of all other algorithms mentioned in the paper. A circuit in a graph G is a sequence [v 1, v 2,...,v k, v 1 ] such that v i v i+1 is an edge of G for all i = 1,...,k 1 and v k v 1 is an edge of G. A chordal graph (also triangulated or rigid-circuit graph) is a simple graph in which every circuit of length 4 or more has an edge connecting two vertices which are non-adjacent within that cycle. A clique in a graph G is a complete subgraph of G. A clique is maximal if it is not a proper subgraph of any other clique in G. A vertex v of a graph G is simplicial if its adjacency set Adj(v) induces a clique. An ordered sequence of vertices σ = [v 1,...,v n ] is a perfect vertex elimination scheme if v i is a simplicial 1

5 vertex of the graph G\{v 1,...,v i 1 for i = 1,...,n. It is shown in [2] that a graph is chordal if and only if it has a perfect vertex elimination scheme. Thus, we have a method to recognise chordal graphs: Algorithm 1 Chordality test using Lexicographic breadth-first search. [10] Input: An undirected graph G on n vertices. begin assign the label to each vertex; for (i = n to 1 step -1) select a vertex v from G with the largest label; assign to v the number i; for (each unnumbered vertex w Adj(v)) add i to label(w); for (j = 1 to n step +1) if (the vertex with assigned number j is not a simplicial vertex) output The graph is not chordal ; end output The graph is chordal ; end The algorithm presented in Section 3 of this paper relies on two previously discovered algorithms. The first is an algorithm that calculates whether a given interval graph is Hamiltonian, and was presented by Keil in 1984 [6]. The other calculates the leafage of any given chordal graph and was presented by Habib and Stacho in 2009 [5]. Due to the heavy reliance on these algorithms, I will present them fully in the following subsections. 1.3 Hamiltonian Circuits in Interval Graphs Keil s algorithm is the key tool used in this paper. It finds whether a given interval graph is Hamiltonian [6]. The algorithm that will be presented in section 3 extends the reach of Keil s to encompass some chordal graphs, the set of which, it is to be seen, is a proper superset of the interval graphs Figure 1: F Let F be a family of non-empty sets. The intersection graph G of F is obtained by representing each set as a vertex and connecting two vertices with an edge if they have a common element. If F is a family of intervals on the real line then G is an interval graph and 2

6 Figure 2: The interval graph G representing F F is called the interval model. Figure 1 displays a set F of six intervals on the real line and figure 2 is the interval graph obtained from F. I now give a proof by Lekkerkerker and Boland that shows the set of all interval graphs is indeed a subset of the chordal graphs. It is important to understand this result in order to grasp the direction being taken in searching for the algorithm in the later sections. It should be noted that the converse of this result is not true and will become apparent in section 1.4. Proposition 1 Every interval graph is chordal [8]. Proof: Suppose the interval graph G contains a chordless cycle of length greater than or equal to 4, say l. So σ = [v 0,...,v l 1, v 0 ] is a cycle in G. Let I k denote the interval corresponding to v k. For i = 1, 2,...,l 1, choose a point p i I i 1 I i. Since I i 1 I i+1 = (otherwise v i 1 is adjacent to v i+1 and σ possesses a chord v i 1 v i+1 ), the p i constitute a strictly increasing or strictly decreasing sequence. Therefore, it is impossible for I 0 and I l 1 to intersect, contradicting that v l 1 v 0 is an edge of G. A circuit in a graph G is a Hamiltonian circuit if it includes each vertex of G exactly once (except of course for v 1 which appears twice). A graph is itself Hamiltonian if it possesses a Hamiltonian circuit. I recall some definitions given in [6]: Let G be an interval graph on n vertices {v 1,...,v n and I = {I 1,...,I n be an interval model of G. A maximal clique C in G corresponds to a set of mutually overlapping intervals in I and, therefore, can be represented by a point p which is contained in exactly those intervals corresponding to the vertices in C. These maximal cliques can be linearly ordered, such that, for every vertex v of G, the maximal cliques containing v occur consecutively [6]. Once ordered, call any maximal clique of G C i where its representative point p i is the i th smallest (see figure 3). Let i be the height of C i. The level of a vertex v (level[v]) is the height of the highest clique in G that contains v. A vertex v that appears in a clique C i is a conductor for C i if v also appears in the clique C i+1. Let L(C i ) be the set {C 1,...,C i of the first i cliques of G. A path P in G is spanning for L(C i ) if it contains all vertices of G that appear only in L(C i ), and P has two conductors of L(C i ) as endpoints. 3

7 p 1 p 2 p Figure 3: The representative points of the cliques C 1 (0134), C 2 (1345) and C 3 (125) Let R i be the set of representative points of the maximal cliques containing v i. A point embedding Q of a path P with n vertices is an assignment of a point q(v i ) from R i to V i such that q(v i ) R i+1 for i n 1. A path is straight if it has a point embedding Q such that q(v r ) q(v r+1 ) for 1 r n 2. Keil then proves that if given a path P in G, with a point embedding Q and a vertex v 1 that appears only in C 1, then there exists a straight path P with v 1 as an endpoint, the same vertex set as P and a point embedding Q that has the same point set as Q. Suppose we have a path P that is spanning for L(C i ) with endpoints A, B. P is U-shaped if there exists a vertex x in P that appears only in C 1 such that the sub-paths from x to A and from x to B are both straight (see figure 4). 0(x) 1(A) (B) Figure 4: G with a U-shaped spanning path for L(C 2 ) Having done a lot of difficult, seemingly obscure work, we now see how important these definitions actually are in terms of our goal: Lemma 1 If G is an interval graph with m maximal cliques, then G has a Hamiltonian circuit if and only if there exists a U-shaped spanning path for L(C i ), for all 1 i m 1. [6] proof: ( ) Assume G has a U-shaped spanning path for L(C i ), for all 1 i m 1. Then there is a U-shaped spanning path P for L(C m 1 ). As P is spanning, it contains all vertices except those in C m and has two endpoints A and B in C m 1 which are both conductors. All that is left is to join A to B via each unvisited vertex in C m and the Hamiltonian circuit is found. ( ) Assume G has a Hamiltonian circuit. Since C 1 is a maximal clique, there exists a vertex 4

8 u in C 1 but not present in C 2, and as the maximal cliques are linearly ordered, u does not appear in any other maximal clique of G. Likewise, there exists a vertex v in C m that is not present in any other maximal clique. Partition the Hamiltonian circuit into two disjoint paths from u to v, P 1 and P 2. As seen above, each path can now be replaced by a straight path extending from u. Call them P 1, P 2. If it happens that v is not the endpoint in such a path, we can just replace the end point with v as v occurs only in C m. We have now obtained our U-shaped spanning path: Let x be the furthest vertex from u in P 1 such that q(x) p i and y the closest vertex to u such that q(y) p i+1 where Q is the point embedding of P 1. If x is a conductor of C i, let A i be the sub-path of P 1 from u to x. Otherwise, let A i be the sub-path of P 1 from u to y. Let B i be defined similarly and U i be defined as the union. Now, both A i and B i are straight, share a vertex in C 1 and contain every vertex in L(C i ), U i is the U-shaped spanning path we desire. As i was arbitrary, this can be done for all 1 i m 1. Thus, we have a method to recognise Hamiltonicity in interval graphs: Algorithm 2 Algorithm for finding Hamiltonian circuits in interval graphs [6] Input: An interval graph G on n vertices, with an ordered listing of its m maximal cliques. This can be found easily as a by-product of Booth and Lueker s interval graph test [1]. begin for (i = 1 to m step +1) enumerate a listing of the vertices in C i ; enumerate a listing of the conductors in C i ; for (j = 1 to n step +1) find level[v j ]; find the two conductors of C 1 of minimum level and label them A, B; if (there are not sufficient conductors in C 1 ) output FAIL: graph is not an interval graph ; end join A to B via each vertex in C 1 of level 1. call this path P; for (k = 2 to m 1 step +1) if (level[a] = k or level[b] = k) find replacement conductors in C k and label them A, B respectively; if (replacement conductors do not exist) output FAIL: graph is not an interval graph ; end join A to one of the endpoints of P; join B to the other endpoint of P, via each vertex in C k of level k; join A to B via each vertex in C m, extending P to a circuit; output P; end 5

9 1.4 The Leafage of Chordal Graphs I now describe the lesser known tool that I will use in this paper, the leafage of a graph, proposed by Lin, Mckee and West [9]. It was shown by Gavril that chordal graphs are exactly those graphs that can be represented as intersection graphs of a collection of subtrees of a host tree [3]. The leafage l(g) of a chordal graph G is the minimum number of leaves in such an intersection representation [9]. Figure 6 displays such a representation of the graph G in figure 5. The representation given has 3 leaves and is in fact l(g). This will be shown later as this example is kept throughout this subsection on leafage Figure 5: A chordal graph G Figure 6: An intersection representation of the graph G in figure 5 A clique tree of G is any tree T whose vertices are the maximal cliques of G such that for every two maximal cliques C, C, each clique on the path from C to C in T contains C C. We label each vertex in the clique tree by a listing of the vertices (of G) in the maximal clique it represents. If an edge connects cliques C and C, we label it by the intersection of the cliques C C. It was shown in [9] that a graph G always has a clique tree with l(g) leaves, and so we can think of these two representations as essentially the same. 7 6

10 Two cliques C, C in G form a separating pair, if every path from a vertex of C\C to a vertex of C \C contains a vertex of C C. The reduced clique graph C r (G) is the graph whose vertices are the maximal cliques of G, with edges between them if they are connected via a separating pair and labelled by the intersection. C r (G) is precisely the union of all clique trees of G [5]. In the implementation, this graph can be more easily constructed using the minimal separator graph H S for a minimal separator S. A minimal separator is a subset S of G such that the subgraph induced by G\S is disconnected and no other proper subset S of S induces a disconnected graph with vertex set G\S. The vertices of H S are all the maximal cliques C of G such that S C, with edges between them if S is a proper subset of the intersection Figure 7: The reduced clique graph C r (G) (left) and the first clique tree representation of figure 5 calculated by algorithm 3 (right) Theorem 1 [5] CC is an edge of C r (G) with label S = C C if and only if C and C belong to different connected components of H S. A clique tree can then be formed from the reduced clique graph quite easily. I recall some notation given in [5]: A degree mapping is quite simply, a map f : V N on the set of vertices in a graph, that assigns to each vertex its degree. A token mapping is a map τ : C S where C is a maximal clique of a clique tree T of G and S is a set of minimal separators in G. The extended degree mapping of T, denoted ǫ T is a token mapping that assigns to each maximal clique C in G the set of tokens corresponding to the edges (labelled by vertices in G) incident with C. A token mapping is realisable if it satisfies all of the following conditions. Theorem 2 [5] A token mapping τ is an extended degree mapping of a clique tree of G if and only if (R1) for each maximal clique C of G, the set τ(c) is non-empty, (R2) for each minimal separator S of G, if a token of τ with label S belongs to τ(c) for some maximal clique C of G, then S C, (R3) for each minimal separator S of G, the number of tokens of τ with label S is exactly 2k S 2 where k S is the number of components of H S, 7

11 (R4) for each minimal separator S of G and every component K of H S, there exists a token with label S in τ(c) for some vertex C of K. The degree of C in τ, denoted deg τ (C) is the number of tokens assigned to C. If deg τ (C) = 1, C is a leaf of T. We can now see where we are going with our definitions. To calculate the leafage of a chordal graph we calculate the leafage of one possible clique tree and then attempt to minimise it with a number of alternating and augmenting paths. Let τ be the token mapping of a clique tree. D τ denotes the digraph with vertices as the maximal cliques of G, and with arcs extending from C to C if the token mapping obtained by removing a token t of τ(c) and giving it to τ(c ), is realisable. A directed path C 1,...,C k in D τ is an alternating path of D τ if deg τ (C 1 ) 3 and deg τ (C i ) 2 for all 2 i k 1. It is augmenting if deg τ (C k ) = 1. Algorithm 3 Algorithm to calculate the Leafage of a Chordal Graph [5] Input: An undirected, chordal graph G on n vertices. begin calculate the maximal cliques of G using algorithm 1 and construct C r (G); construct some clique tree T of G; construct the extended degree mapping τ = ǫ T ; construct D τ ; while (there exists an augmenting path P in D τ ) for (each arc e = CC of the path P) remove a token with the same label as e from τ(c) and add it to τ(c ); update D τ with the new token mapping τ; update the clique tree T based on the new token mapping τ; output the clique tree T and the number of leaves of T end Figure 8: The digraph D τ (left) and the final clique tree outputted by algorithm 3 (right) In the example, the algorithm first calculates the four leaved clique tree depicted in the figure 7 (right). D τ in figure 8 (left) is calculated for this tree and the clique tree given in figure 8 (right) is obtained. The digraph of this tree is also calculated but found to have no 8

12 augmenting paths and so this tree is given as output with l(g) = 3. This tree corresponds to the previously seen interval representation given in figure 6. This algorithm concludes this subsection on the leafage and the discussion of tools and results previously discovered by other authors. The main ideas taken forward are the three algorithms used to calculate chordality, Hamiltonian circuits in interval graphs and the leafage of chordal graphs. These have all been implemented in C++ as a tool to further understand the material and to take it forward in ways which will be described in the next section. The interested reader can find the source code for these implementations in appendix C and there is further information about them in section

13 2 Overloading Separators and Forced Paths It is now possible to see the direction being taken in order to check Hamiltonicity in chordal graphs. First the leafage is calculated, along with a possible clique tree representation T of the chordal graph being tested. Keil s algorithm is then carried out on each of the interval subgraphs starting on each leaf of T and ending on the first clique of degree greater than two. This algorithm will also be used to calculate possible paths along the interval subgraphs between two cliques of degree greater than two. The U-shaped spanning paths thus obtained are then connected within the cliques of degree greater than two and the Hamiltonian circuit is obtained. If at any point, Keil s algorithm fails on any interval subgraph, there is no U-shaped spanning path and therefore no way that the whole graph can be Hamiltonian. C4 C5 C1 C2 C3 C6 Figure 9: A clique tree representation of a graph with leafage 3 and a U-shaped spanning path stemming from the leaf C1 It is now then just a problem of how to connect these U-shaped spanning paths. Unfortunately, this is not as easy as it first looks and much work needs to be done. I will start with some definitions: Definition 1 Consider a chordal graph with a clique tree representation T. The cliques of T with degree greater than two are the central cliques of T. Any paths extending from a central clique of T that end either on a leaf or another central clique are branches of that central clique. Cliques adjacent to central cliques in T will be called penultimate cliques, and cliques occurring before penultimate cliques in a branch will be called antepenultimate cliques. For example, in figure 9, C3 is the only central clique and the path C1, C2, C3 is a branch of C3. C2, C4 and C6 are penultimate cliques and C1 and C6 are antepenultimate cliques. The red arrows represent a possible U-shaped spanning path starting at the leaf C1. How then, given that U-shaped spanning paths exist for all branches off of a central clique, are they connected? I devote the rest of this section to the descriptions of two tools I found to be useful in tackling this task. 2.1 Overloading Separators Definition 2 A separator S of a chordal graph G has been overloaded if the number of connected components of H S (see section 1.4) exceeds the number of vertices in S. 10

14 Consider the chordal graph given below in figure 10. It is not too difficult to see that the leafage algorithm would yield a clique tree with a central clique comprising of the vertices 1, 2 and 3 which stems out to the 4 other cliques, using separators {1,2,3 and {1,3. {1,3 is not overloaded. There are 2 connected components in H 13, 0245 and 6. However, H 123 has connected components 0, 4, 5 and 6 and so has been overloaded. This ties in directly to the goal using the following result: Figure 10: Chordal graph with an overloaded separator Proposition 2 Let G be a chordal graph. If any separator S in G has been overloaded, then G is not Hamiltonian. Proof: Let S be the separator that has been overloaded and let it have size k. Then H S has over k connected components, say m where m > k. Let us start a Hamiltonian circuit from any vertex in S. We will have to leave S (and return) at least m times in order to visit all components of H S. This must use at least m vertices but S only has k and so there is no Hamiltonian circuit. It is important to note that this result applies to all separators in G, and not just those that are minimal. So, how do we check these efficiently without just checking all 2 n -1 subsets of G? First we must find out in what cases these non-minimal separators crop up, and this is when we have a certain number of forced paths. 2.2 Forced Paths Definition 3 Consider a chordal graph G and its clique tree representation T. Consider a U-shaped spanning path starting from a leaf in T that extends to a central clique. If there are only 2 conductors of the penultimate clique, the path produced using Keil s algorithm, ending with these two conductors is a forced path. 11

15 There may be any number of paths that could be used to traverse these vertices within our forced path, but all of them end with these two conductors. These conductors form a minimal separator of size 2, which can only be entered twice at most, or else it would be overloaded, and therefore the graph would not be Hamiltonian. Thus, there are two sides of the separator, one of which we know to have a U-shaped spanning path. Lemma 2 Consider a chordal graph G and its clique tree representation T. Consider a U- shaped spanning path starting from a leaf in T that extends to a central clique where the penultimate clique has only two conductors, say a and b. Let the set of all vertices in the U-shaped spanning path be denoted P. G is Hamiltonian if and only if the chordal graph induced by the set of vertices G\P {a, b has a Hamiltonian circuit using the edge ab. Proof: ( ) Assume G is Hamiltonian. Then there exists a Hamiltonian circuit [a, v 1,...,v k, b, v k+1,...,v n 2, a] that uses the U-shaped spanning path [a, v 1,...,v k, b]. So there exists a Hamiltonian path [b, v k+1,...,v n 2, a] in G\P {a, b. Add the edge ab to obtain the Hamiltonian Circuit. ( ) Assume G\P {a, b has a Hamiltonian circuit using the edge ab. Just remove the edge ab and add the U-shaped spanning path to the Hamiltonian circuit. By reducing the problem like this, we see that these two conductors must be used in this way, and can therefore be treated as if they have already been used in a Hamiltonian circuit, if one exists. Definition 4 Let G be a chordal graph. A vertex v in G has been unused if it appears in no forced paths in G. It is half-used if it appears in one forced path, used if it appears in two forced paths, and over-used if it appears in more than two forced paths. Certain cases where a graph is not Hamiltonian can now be flagged up by spotting overused vertices. Proposition 3 Let G be a chordal graph that contains an over-used vertex. G is not Hamiltonian. Proof: G contains an over-used vertex v. So it is a conductor used in say p forced paths in G, where p > 2. These conductors must be used once each to reach the p paths and so v is used p times in any circuit that traverses all vertices of G. This is more than twice, and so the circuit is not Hamiltonian. The most basic form of this case can seen in figure 11. Here is a chordal graph of leafage three with no overloaded separators. The central clique is that of 0123 and every branch that stems off 0123 is a forced path. The problem arises because the vertex 0 is used in three forced paths and is, therefore, over-used. Forced paths also cause problems when they form circuits. Look again at figure 11, but now imagine the vertex 6 is connected to 1 and 2, rather than 0 and 3 so no vertex is over-used. Finding a Hamiltonian circuit in this graph is the same as finding a Hamiltonian circuit in the subgraph induced by 0123, while using the edges 01, 12 and 02, by the result from lemma 2. It could be said that the separator 012 has been overloaded, but notice that this separator is 12

16 not minimal and we have the case that was mentioned at the end of section 2.1. This answers our question of where to search for non-minimal separators. We just check for the overloaded separator where forced paths create a circuit. We cannot, however, immediately dismiss a graph as non-hamiltonian when forced paths do create a circuit, as they may in fact traverse all of the central clique. It should be noted then that an algorithm that calculates Hamiltonian circuits in chordal graphs would need to not only keep track of which vertices are half-used and used when forced paths crop up, but also which vertices are connected via each forced path Figure 11: A chordal graph with no overloaded separators but not Hamiltonian 13

17 3 A Case Analysis All tools have now been discussed and so the algorithm promised in the title of the paper can now be tackled. Due to the high complexity and number of cases that the algorithm has to deal with, I describe the problems a potential algorithm must overcome one by one, as each case is visited. The algorithm is then recounted in full at the end of the section. I shall start with the most simple case where there is one central clique of degree three. The algorithm can then be expanded to central cliques of higher degree and to include paths between two different central cliques. The forced paths within a chordal graph can now be used to separate the different cases that may occur in trying to connect the U-shaped spanning paths within the central clique. When the central clique has degree three at most, there can be a maximum of three forced paths, and a minimum of zero. 3.1 Three Forced Paths The first case is when there are three forced paths. This is the easiest case, as there are the least number of variables to deal with. There are three U-shaped spanning paths that terminate with three pairs of penultimate clique conductors. The desired algorithm would need to recognise this case and return a negative result if any conductor is over-used (used exactly three times in this case where the central clique has a maximum degree of three), or if any separator is overloaded (whether minimal or a complete subgraph on three vertices induced by the conductors). Otherwise, paths can be added within the central clique to join these conductors along with any other unused vertices in the central clique. Note: Up to three connecting paths are needed. If there are a total of six half-used conductors, no conductor is shared by the three forced paths and three more connecting paths are needed to join these conductors. Two are needed for five conductors (one used, four half-used), one for four (two used, two half-used), and of course none are needed in the case that the forced paths already create a Hamiltonian circuit. 3.2 Two Forced Paths Things get a lot more complicated when not all paths are forced. Forced paths are easier to deal with as there is no choice of which penultimate clique conductors to use. Therefore, as seen in the previous subsection, we can let Keil s algorithm run until it outputs a U-shaped spanning path with these conductors as endpoints without worrying about cutting our options. When there is a choice of conductors, Keil s s algorithm needs to be halted as soon as it reaches the first two conductors of the antepenultimate clique. The reason for this is that if we let Keil s algorithm run until it gives us a U-shaped spanning path for the whole branch, including the penultimate clique, we are left with the two conductors Keil s algorithm outputs, as if the path was forced. If this creates an over-used vertex or an overloaded separator, a negative result is obtained, when really there are more options for which conductors we could have used, perhaps in a way that yields a Hamiltonian circuit. It should be noted that this system is not yet sufficient, though this will become apparent in the end of this subsection. Assume now that we have a central clique of degree three with two forced paths and a U-shaped spanning path that reaches up to two conductors of the antepenultimate clique. It 14

18 may be the case that one or both of these conductors are also conductors for the penultimate clique as well. To illustrate this, look again at the graphs in figures 5 and 8 (right). Here we have a clique tree with two forced paths, [3,5,6] and [4,7,6]. The third branch is that with cliques 0134, 1234 and ending on the central clique Keil s algorithm, stopping as soon as we have the first two conductors of the clique before the penultimate either returns {1,3, {1,4, or {3,4. It does not matter at this stage which of these pairs it is (as they are all of minimum level. See section 1.3) so let us assume it is the pair {1,3. 1 and 3 are also both conductors of the penultimate clique, as well as the antepenultimate, and we have an instance of this sub-case. So we now have three sub-cases: 1. The third branch has two conductors of the penultimate clique after Keil s algorithm has been halted. 2. The third branch has one conductor of the penultimate clique after Keil s algorithm has been halted. 3. The third branch has no conductors of the penultimate clique after Keil s algorithm has been halted. In order to be more concise, let the central clique be denoted C, the penultimate clique be denoted B and the antepenultimate clique be denoted A. Let all vertices in B but not C be denoted B\C as usual Two conductors already met When Keil s algorithm outputs two conductors of B for the last branch, we are presented with what looks like a forced path, in that there is a U-shaped spanning path ending with two conductors (of A and B) in C. What separates this from the forced path case is that there may well be vertices in B\C that have yet to be visited. However, we know this is not a forced path and that we stopped Keil s algorithm on the first two conductors of minimum level of A. So there is at least one more vertex of equal or higher level, i.e. another conductor for B. All that is left to do is to extend our U-shaped spanning path from one of the outputted conductors around all unused vertices in B\C, and ending on this conductor. This is possible depending on the positions of the other two forced paths. Consider figure 12 and its clique tree representation with minimum leafage, figure 13. This graph has no overloaded separators or over-used vertices. Yet, it is not Hamiltonian. There are two forced paths, [1,2,6] and [3,4,7]. Keil s algorithm is used on the third path until it halts on the first two conductors of the antepenultimate clique (023), 2 and 3. Thus it outputs the U-shaped spanning path [2,0,3]. The penultimate clique 2358 has not yet been fully traversed, but 2 and 3 are both already half-used and so the path is taken outside of Because there still exist vertices in 2358 not in the central clique (vertex 5), 2358 needs to be revisited. This cannot be done as there is only one conductor left (the vertex 8). Now look at figure 14. It has a clique tree similar to that in figure 13 with a central clique of size 6, The same thing happens. The U-shaped spanning path given by Keil s algorithm gives two vertices that are conductors of B. They are also both half-used in forced paths, taking the paths outside of B, despite B not having been fully traversed. But this graph clearly has a Hamiltonian circuit. Just use all the outermost edges in the graph representation given. 15

19 Figure 12: A chordal graph with 2 forced paths This problem can be solved in two steps. First we give Keil s algorithm an extra rule in choosing conductors. After finding all conductors of minimum level, it should then ask how used the conductor is, favouring unused to half-used. This changes the conductors at the end of the U-shaped spanning path and ensures this case is avoided if possible. If it is unavoidable, and the algorithm still outputs a U-shaped spanning path into two half-used conductors, this effectively becomes a forced path. After checking the separators to make sure there is no forced path circuit, the algorithm then searches for two other conductors in B with which to connect all other vertices in B. They must either be unused or half used, providing the pair are not two half-used conductors that create a circuit not encompassing all of C. If such conductors exist, the graph is Hamiltonian and all paths are joined in the usual way Figure 13: A clique tree of the graph in figure 12 16

20 Figure 14: A chordal graph with 2 forced paths When the forced paths do not immediately take the two conductors of the third path outside of B, the case is more simple. A third conductor is searched for. If found, a path is then extended from one of the first two conductors (at least one is only half-used), through B to the new conductor. For example, look again at figure 12 and imagine the forced path connecting vertices 3 and 7 connect 7 and 8 instead. The third path obtains 2 and 3 as conductors of the antepenultimate clique 023, which are both also conductors of the penultimate clique A third conductor is searched for and the vertex 8 is found suitable. The current path [6,1,2,0,3] is extended from 3 through 5 to 8. This reaches the second forced path which takes the path to [6,1,2,0,3,5,8,4,7]. One more path is needed to connect the two half-used vertices 6 and 7 in the central clique. It need not go through any other central clique vertices as they have now all been used so finding the path is obvious. I end this subsection with a short discussion on a tool already used that would be vital in the implementation of the desired algorithm. Whenever any path is extended, it labels the vertices either used or half-used. It must also, however, keep track of every separate path created along with their current end-points in order to make sure no circuits are formed prematurely. This is seen in the sub-case just described as the two conductors found using Keil s algorithm are both in C and so we obtain something similar to a forced path. 17

21 3.2.2 One conductor already met Given that the last branch has one conductor of B already met, things are much more simple. Let this conductor be called a and the other, lower level conductor in B\C, be called b. The algorithm searches for a conductor of B that is unused. If this does not exist, it searches for a half-used conductor whose forced path does not end with a, unless it traverses every other vertex of B. The path is extended from b around all other vertices in B\C and then to the conductor just found. All paths are now joined using the same method used for three forced paths if necessary. An example of such a case is given in figure 15. It can be seen somewhat easily that the clique 2345 is the central clique (just construct the clique tree representation T using the leafage algorithm). It has two forced paths connecting vertices 4, 5 and 3 with the third branch consisting of the penultimate clique 1234 and the antepenultimate clique 014 (also a leaf in T). Keil s algorithm will halt on the first two conductors of the penultimate clique which happens to be 1 and 4 in this case. 4 is also a conductor of the penultimate clique and so is the conductor a. 1 is b. The algorithm searches for an unused conductor in 2345 and finds 2 so a path is extended from b to 2 (B\C = {1, which has already been visited in the path), and the circuit [0,1,2,3,6,5,7,4,0] is obtained. If the reader wishes to see an example where no unused conductor is found, consider the graph induced by all vertices in figure 15 except 2. There is no unused conductor left when the third branch searches to extend b. Instead the half-used conductor 3 is found, which although forms a circuit, it is one that traverses the whole of the central clique (345) and, therefore, all vertices in the graph Figure 15: Chordal graph of leafage three with two forced paths and one conductor already met in the third branch 18

22 3.2.3 No conductors already met The case that the last branch has no conductors of B already met is similar to one conductor directly above. The difference is the algorithm just needs to find two unused or half-used conductors of B. Providing the pair of conductors chosen do not create a circuit that does not traverse all of C, the graph is Hamiltonian and paths are connected in the usual way if they are not connected already. 3.3 One Forced Path In the following sections, the A, B, C notation is used sparingly to avoid ambiguity between the branches yet to be properly connected to the central clique. Suppose we have a central clique of degree three with one forced path. There are two U-shaped spanning paths P 1 and P 2, each with zero, one or two conductors. This then yields six sub-cases. In each of these, extra conductors need to be found for at least one of the paths P 1 and P 2. All possible conductors that can be used (i.e. are unused or half-used and do not form a circuit) for the paths are split into three disjoint sets: S 1 : the set of conductors that can only be used by P 1 S 2 : the set of conductors that can only be used by P 2 S s : the set of conductors that can be used by both P 1 and P 2, i.e. shared conductors P 1 will then try to find conductors in S 1 before searching in S s. P 2 then chooses conductors from S 2 before searching in S s. Order does not matter here as the conductors in S s all have a predetermined usage. They are either unused or half-used and independent of either path (else a path would form a circuit by using such a conductor and contradict it being in S s ). Unused conductors can be used by both paths, as long as the paths are not already connected as this would create a circuit. If paths are already connected they can be used once (unless the circuit encompasses all vertices in the central clique). Half-used conductors can only be used by one of the paths. If there are enough conductors for both P 1 and P 2, the graph is Hamiltonian. The paths are formed and then connected in the usual way. If they cannot be found, the graph is not Hamiltonian. I now go on to describe each of the six sub-cases. It is easy enough to conceptualise the first three together: , 1-0 or 1-1 Suppose both P 1 and P 2 have zero conductors of the penultimate clique already met, both have one conductor of the penultimate clique already met, or one path has one met and the other zero. These cases have no upsetting consequences and the sets described above are formed without worry. Conductors are searched for and if found the graph is Hamiltonian. Four conductors are needed for the first of these cases, three are needed for the second and two are needed for the third or 2-1 Suppose one of the paths has two conductors already met, the other having zero or one. In the latter case, there are five conductors of the central clique met and so it should be checked 19

23 Figure 16: A chordal graph representing case 2 1 that no vertex has been over-used before continuing. Let the path with two conductors be P 1 without loss of generality. The problem here is that if there are other vertices in the penultimate clique of P 1 not yet visited, another conductor needs to be found as seen in section Once it is known if another conductor is needed, the three sets are formed, and the algorithm can return false if there are not sufficient conductors available to either path. An example of the 2-1 case can be seen in figure 16. This graph has a clique tree representation of minimal leafage as seen in figure 17 which the reader can refer to for greater clarity on how the proposed algorithm will run. The path [6,7,8] is the only forced path. [1,0,8] and [3,5,6] are not forced but are the U-shaped spanning paths outputted by Keil s algorithm and act as such, and so are also highlighted in the diagram. After finding these paths the algorithm then checks for over-used vertices, of which there are none. It is established that the branch on the right in the clique tree representation, say P 1, needs a third conductor, as there exist unvisited vertices in 2346\ 2368 (4), and so the sets are formed. S 1 =, S 2 = and S s = 2 (The vertex 3 is unusable by P 2 as it forms a circuit prematurely). It is seen that 2 is currently unused and so can be used by the path P 1. P 1 extends a path from 3 through 4 to 2. S s = 2 still, only now 2 is half-used so it is checked whether the circuit formed would encompass all of the graph. It would as 2 is the last vertex and so a Hamiltonian circuit is obtained by extending the path P 2 to 2. 20

24 Figure 17: A clique tree of the graph in figure Suppose both P 1 and P 2 have two conductors already met. In this case there are effectively three forced paths at this stage so the central clique should be tested for over-used vertices and overloaded separators. It is then asked whether P 1 and P 2 need a third conductor and these are then searched for using the three sets. Look again at figure 16 but now imagine the edge 01 is removed and an edge 02 is added to the graph. A similar clique tree is obtained using the leafage algorithm but we now have the case discussed in this subsection. It is found that both branches need another conductor to revisit the unused vertices in the penultimate cliques so the sets are formed, except S 1 = S 2 = S s =. Neither of the half-used conductors 2 and 3 can be used by either path as they form circuits that do not encompass the whole graph. Then there are not sufficient conductors and the graph is not Hamiltonian. Indeed, we can convince ourselves of this fact by observing that the separator 2368 is overloaded. This concludes all the sub-cases for one forced path. 3.4 No Forced Paths and a Potential Problem When there are no forced paths, there are nine sub-cases to consider. My original idea was to treat them similarly to the case of one forced path. The algorithm would check how many paths already have two conductors of the penultimate clique already met. These are treated as forced paths and over-used vertices and overloaded separators are searched for within the central clique. If there are none, the algorithm works out how many conductors each path needs and the sets of conductors are formed. This is where the problem lies as the order of the paths is now an issue. Obviously, conductors exclusive to one path can still be used without regard to the others, but if all three paths still need conductors after this stage, it is not clear which path should take first pick of the shared conductors. I therefore propose the algorithm repeats the process three times, starting with each different path. Once the first path has chosen conductors, the case is similar to one forced path and order will no longer matter. If any of them succeed in finding conductors for all three paths, the paths are connected and a Hamiltonian circuit is obtained. If all fail, the graph has no Hamiltonian circuit. This concludes the case analysis and each sub-case has now been covered in some detail. I now recount the algorithm to clear up any confusion that may have been accrued over such a long explanation: Algorithm 4 Algorithm to check Hamiltonicity in Chordal Graphs of leafage less than four 21

25 INPUT: An undirected chordal graph G on n vertices with leafage less than four. begin perform algorithm 3 to obtain a clique tree representation T of G; if l(g) < 3) perform algorithm 2 on G; end for (each branch B of T) if (B contains a forced path) perform algorithm 2 on B, halting on the only two conductors of the penultimate clique; else perform algorithm 2 on B, halting on the first two conductors of the antepenultimate clique of minimum level and minimum usage; if (there is an over-used vertex or an overloaded separator in the central clique) output FAIL: the graph is not Hamiltonian ; end if (there are 3 forced paths) join paths using all unused vertices in the central clique; output The Hamiltonian circuit obtained; end if (there are 2 forced paths) find the number of conductors necessary to connect the last path to the central clique properly; comment Two are needed if no conductor of the penultimate clique has already been reached or if two have been reached and are both used in forced paths taking the path outside the penultimate clique as seen in section One is needed if only one conductor of the penultimate clique has been reached or if two have, there still exist unvisited vertices in the penultimate clique but not the central clique and the case above does not apply. if (there are sufficient conductors to properly connect the last path to the central clique) connect the last path and join all paths using all unused vertices in the central clique; output the Hamiltonian circuit thus obtained; end else output FAIL: the graph is not Hamiltonian ; end if (there is 1 forced path) form the sets S 1, S 2 and S s ; if (there are sufficient conductors to properly connect the last 2 paths to the central clique) connect them and join all paths using all unused vertices in the central clique; output the Hamiltonian circuit thus obtained; else output FAIL: the graph is not Hamiltonian ; end if (there are no forced paths) 22

26 form the sets S 1, S 2, S 3 and S s ; utilise all conductors in exclusive sets; if (all paths still need conductors) for (each path P) for (each pair of conductors available to P) if (there are sufficient conductors to properly connect the last 2 paths to the central clique) connect them and join all paths using all unused vertices in the central clique; output the Hamiltonian circuit obtained; end output FAIL: the graph is not Hamiltonian ; end else if (there are sufficient conductors to properly connect the last 2 paths to the central clique) connect them and join all paths using all unused vertices in the central clique; output the Hamiltonian circuit obtained; end else output FAIL: the graph is not Hamiltonian ; end 23

27 4 Evaluation 4.1 Evaluation of the Current Algorithm An algorithm to check Hamiltonicity in chordal graphs with leafage less than four has now been obtained. The correctness of the algorithm is seen the case analysis in section 3. All possible instances are explored and each of their subtleties are dealt with individually. In the case of no forced paths and all paths still needing conductors after all exclusive conductors have been utilised, the algorithm does an exhaustive search of conductors. There is no real bound on the amount of conductors so this takes C(n, 2) (n choose 2, where n is the number of vertices in the graph) steps in the worst case which is in time O(n 2 ). This path then effectively becomes a forced path and is treated like the case of one forced path. All other steps in the algorithm are linear, aside from running algorithm 3 which runs in time O(n 3 ) [5], so algorithm 4 runs in O(n 3 ) also. The algorithm therefore runs in polynomial-time, and a step towards finding a polynomial-time algorithm to find Hamiltonian circuits in all chordal graphs has been taken. The complexity of this algorithm, although polynomial, could still probably be significantly reduced. Habib and Stacho state in [5] that their complexity analysis is not very tight and that a more efficient algorithm is likely. I would then research the case of no forced paths in order to reduce the number of searches for conductors. 4.2 Generalising the Algorithm to All Chordal Graphs The original goal was to obtain an algorithm to check the Hamiltonicity of any chordal graph but, unfortunately, the case analysis branched out into too many sub-cases right at the end of the research period. The issues that remain a problem at the end of the project are: 1. Reducing the number of searches in the case of no forced paths. 2. Allowing paths between two central cliques. 3. Allowing central cliques of higher degree Reducing the Number of Searches in the Case of Zero Forced Paths This is perhaps the most taxing problem on generalising the current algorithm to all chordal graphs. Consider a central clique with more than three branches. If more than three branches, say x, still need conductors after exclusive conductors have been utilised there are x! 2 possible orders of paths each needing to cycle through up to C(n, 2) different pairs of conductors. A polynomial-time algorithm could be found for bounded leafage but it escalates very quickly and the algorithm would not be able to be extended to all chordal graphs. I would start trying to solve this problem by searching for examples in the case of leafage three as mentioned at the end of section 4.1, and test the different orders. It may be that a hierarchy of shared sets should be used, and conductors used by only two paths should take precedence over those used by more. It may be that, like in the case of two paths, order does not matter, and any order would in fact be sufficient. 24

28 4.2.2 Allowing Paths Between Two Central Cliques This is probably the easiest task left to be conquered. It has always been in the back of my mind that it could be accomplished simply by performing Keil s algorithm on the interval subgraph formed using the first central clique say C 1 and the path used to reach the second central clique C m. The conductors in C 1 of lowest level would then be taken as the possible conductors to be used for that branch in the central clique C 1. There is some work to do in finding which other conductors in C 1 can be used, but in the worst case, Keil s algorithm can just be carried out on such a branch twice, once in each direction Allowing central Cliques of Higher Degree This is certainly the most challenging problem to overcome in this project in terms of time investment. The number of sub-cases is already extremely large for central cliques of degree three and will only increase when more branches are added. The problem in section will also need to be solved before moving on to this one. It is, however, the key obstacle to overcome in order to fully solve the problem of finding Hamiltonian circuits in chordal graphs using this method. I do not foresee any major problems in carrying out this generalisation as the cases should resemble those already met for central cliques of degree three. I expect to find a small number of unfamiliar cases but, for the most part, they should be solvable using methods already seen and discussed. Given more time, I would like to perform a case analysis on chordal graphs with central clique of degree four. This would highlight any unexpected unseen cases, if they exist, but mostly help by generating examples to be used in proving why the same methods can be used on more complex cases. 4.3 Implementations It is mentioned at the end of section 1 that algorithms 1, 2 and 3 were implemented using C++. All of these can be found in appendix C. Each of the implementations have been tested on the graph examples seen in this paper, the main example given in [5] and on many others from Golumbic s book [4]. They have been tested extensively on many graphs of my own creation, designed specifically to work every possible branch of my code. I am therefore confident in claiming them to be accurate. Keil s algorithm requires as input an interval graph along with an ordered list of its maximal cliques [6]. Keil suggests this ordering should be acquired using Booth and Lueker s interval graph recognition algorithm [1] which runs in linear time (O(n+e)). This algorithm requires the use of PQ-trees and for the implementation to recognise and deal with eleven possible templates. Due to the time-restriction on the project, I did not want to go into such a complicated implementation as any unexpected problem might add days to the task. I therefore decided to use the PQ-tree data structure given in the LEDA library (Library of efficient data types and algorithms). This proved to be a problem itself, both in installing the software and in using PQ-trees. As time ran out, I decided to order the cliques using a different method. In the end, I used the leafage algorithm to check whether the leafage of the given graph was less than three (which all interval graphs are) and then to output a clique tree giving the ordering required. The downside of this method is of course that the leafage algorithm runs in O(n 3 ), and so my implementation of Keil s algorithm also runs in O(n 3 ), 25

29 rather than in linear time. I am not too worried about this, however, as this is a theoretic project and the use of my programme is as a tool in research, a role in which it excelled. It was part of the aim of this project to implement the final algorithm that calculates Hamiltonian circuits in chordal graphs. An algorithm to calculate Hamiltonian circuits in chordal graphs of leafage less than four was obtained but not implemented. Such an implementation would not be too difficult to develop but it would take a sizeable time investment. This is a commodity I did not have and consequently no implementation is given. If an implementation was attempted, the programmer would not have to consider any problems that exceed the difficulty of the other algorithms in section 1. There would be many data structures that would be consulted throughout the programme, much like the graphs built in algorithm 3 and many loops in the case of no forced paths, but nothing too worrying. A set intersection function may need to be defined when looking at the sets S 1, S 2 and S s though this has already been done in the implementation of algorithm 3, using the set advanced data type (see appendix C). 4.4 Methodologies Used Due to the nature of the project no formal methodology was used. The direction of approach and tools to be used to assist research (e.g. the implementations of the algorithms) were outlined early on in the project. These tools were developed and research continued from there. A project log was kept throughout in order to organise the project and to recall past ideas. A proposed solution was developed quite quickly and built on whenever a problem presented itself. This is a system quite common in theoretical research and I felt it worked well. The case analysis presented in section 3 was very useful in the research but unfortunately it was developed quite late on in the project. Had it been introduced earlier, more time could have been spent pushing the algorithm to cover more cases than it currently does. 26

30 A A Reflection on the Project Experience I cannot count the number of times I discovered the algorithm that solves the problem of Hamiltonicity in chordal graphs. Happy in the knowledge that the new, improved algorithm deals with the latest found counter-example, I would put my pen and mind to rest as I carried on with other, less important tasks, only to enter a new panic sometimes a month down the line, as I find a new discrepancy with it. This was my first proper tangle with theoretic research and it probably shows in the way I tackled it with such naivety. Every time I thought I obtained my algorithm, I failed to carry out a complete case study that could refute the possibility of further problems. It was only right at the end of the research period that this was carried out and consequently the end-product is not complete. I am of course distraught with the way things turned out and I would like to advise any students carrying out theoretic research in mathematics or computer science to write out all proofs in full as soon as they are acquired. They should then be checked and re-checked before any other task is considered as the project is nothing without them. It seems like a statement too obvious to mention and perhaps insulting to hear but I feel it is a trap easier to fall into than one might think. Having put hours of work into a result you believe to be correct, discovering it is false is the last thing you want to find and so checking becomes a secondary task despite its importance. My biggest mistake in this project was to misinterpret the purpose of the interim report. I thought it was a check up on my progress, a paper-work exercise where a box was ticked and I could return to the actual project work after completion. It was not. The interim report, as well as the progress meeting later on, are tools to be used by the student in order to complete the task successfully and, ultimately, to achieve a good mark. I received detailed feedback from both my supervisor and assessor on all aspects of the project. It was at this point in the project that I already had a solution of which I was quite proud, but it did not get submitted in my report, as I had not yet checked it completely. Consequently, it took another week before holes were found in its proof. Any students reading this should use the interim report to its full potential. List all accomplishments whether or not they have been written up neatly or even complete. The report is not marked and serves only to help you succeed. This is a point that carries significantly more weight with those students conducting theoretical research. This project taught me that ideas become twice as clear when they are discussed. Use the interim report and all weekly meetings to their full by talking over the results obtained during the week no matter what stage they are in. Another problem I experienced in my project was that the LEDA library, the only resource I required in my project was not available for several weeks. When I finally got the software to install, I never managed to use the PQ-tree data structure it contained as the documentation described only algorithms that use PQ-trees, omitting how to actually use the PQ-trees themselves. This is a problem that lasted longer than a month and so delayed the completion of my minimum requirements and caused much stress. Having spent so long on this project I am now somewhat confident in stating that problems like this are in fact inevitable in any large project. The way I dealt with the problem was with good time management. I made sure there were always several tasks at any one time in case any brick walls like this were met. I expected to encounter full stops like this, albeit in the theoretical side of things, and so I had plenty to be getting on with. I urge all future students reading this to do the same. In the end, I resolved the problem by using a different algorithm (see section 4.3 in the Evaluation). The last thing I would like to say to students about to begin their projects is good 27

31 luck and enjoy it. It may sound like my project experience was riddled with problems, stress and anguish but this is not the case. I thoroughly enjoyed the theoretic research and the implementations of previous algorithms. I have regrets about how I failed to achieve a complete result but I still solved the problem for some chordal graphs. It is a small contribution on its own but together with my report highlighting lines of future investigation (which, given more time, I would have ventured down myself) I feel I have made progress in the field. This, along with the satisfaction of having learnt much about programming, latex, Linux, graph visualisation, computational complexity, and working on large projects has left me with the feeling that the project was actually quite a success. B Interim Report Document is attached after the bibliography. C Implementations C.1 The Advanced Set Data-type #include <set> #include <iostream> using namespace std; template <typename T> class set_advanced : public set<t>{ public: typedef T value_type; set_advanced<t> () { bool subset (set_advanced<t> c){ // Return true if subset for (typename set_advanced<t>::iterator i = c.begin(); i!= c.end(); ++i){ typename set_advanced<t>::iterator iter = this->find(*i); if (iter == this->end()){ return false; return true; static set_advanced<t> intersection(set_advanced<t> A, set_advanced<t> B){ // Return the set intersection set_advanced<t> C; typename set_advanced<t>::iterator k = B.begin(); for(typename set_advanced<t>::iterator j = A.begin(); j!= A.end(); ++j){ while(k!= B.end()){ if(*j == *k){ C.insert(*k); k++; k = B.begin(); return C; static set_advanced<t> set_union(set_advanced<t> A, set_advanced<t> B){ // Return the set union set_advanced<t> C; for(typename set_advanced<t>::iterator j = A.begin(); j!= A.end(); ++j){ C.insert(*j); 28

32 for(typename set_advanced<t>::iterator k = B.begin(); k!= B.end(); ++k){ C.insert(*k); return C; ; C.2 Chordality Test #include <iostream> #include <fstream> #include <vector> #include <deque> #include <set> #include "set_advanced.h" using namespace std; int main (){ //INPUT GRAPH FROM TEXT FILE ifstream infile ("house.txt"); //Input graph. int N, edge; infile >> N; vector <vector<int> > graph; for (int a = 0; a < N; a++){ vector<int> row; for (int b = 0; b < N; b++){ infile >> edge; row.push_back(edge); graph.push_back(row); // Graph is read. //USE LEXICOGRAPHIC BREADTH FIRST SEARCH vector<vector<int> > labels; for (int c = 0; c < N; c++){ vector<int> vertex; vertex.push_back(c); labels.push_back(vertex); //Give each vertex (0 to N-1) a vector with their name and an empty set of labels. deque<int> VES; //Initialise the vertex elimination scheme as empty. vector<bool> order(n); //Keeps track of which vertices have been used already. for (int d = 0; d < N; d++){ vector<int>::size_type maximum = 0; for (int e = 0; e < N; e++){ if (labels[e].size() > maximum && order[e] == 0){ maximum = labels[e].size(); //Find maximum label. for (int f = 0; f < N; f++){ if (labels[f].size() == maximum && order[f] == 0){ //Finds vertex with greatest label. VES.push_front(labels[f][0]); //Assigns this vertex label to the front of the vertex elimination scheme. for (int g = 0; g < N; g++){ if (graph[f][g] == 1){ labels[g].push_back(f); //Assigns this vertex to adjacent vertex labels. order[f] = 1; //"Vertex f has been used already." break; //CHECK THE ORDER GIVEN IS A PERFECT VERTEX ELIMINATION SCHEME bool chordal = 1; //Initialise Graph to be chordal. vector<bool> eliminated(n); //Keeps track of which vertices have already been eliminated. for(int h = 0; h < N; h++){ 29

33 vector<int> clique; for (int i = 0; i < N; i++){ if ((graph[ves[h]][i] == 1 i == VES[h]) && eliminated[i] == 0){ clique.push_back(i); // forms a clique, built from the hth vertex in VES. for (vector<int>::size_type j = 0; j < clique.size(); j++){ for (vector<int>::size_type k = 0; k < clique.size(); k++){ if (graph[clique[k]][clique[j]] == 0 && j!=k){ // If clique formed is not complete, graph is not chordal. chordal = 0; eliminated[ves[h]] = 1; //OUTPUT THE RESULT if (chordal == 0){ cout << "Negative: The graph is NOT chordal." << endl; else{ cout << "Yes, the graph is chordal. It has a perfect vertex elimination scheme:" << endl; for (int l = 0; l < N; l++){ cout << VES[l] << " "; cout << endl; return 0; C.3 Habib and Stacho s Leafage Algorithm /****FOLLOWS FROM CHORDALITY TEST****/ //RECOGNISE WHEN GRAPH IS NOT CHORDAL if (chordal == 0){ cout << "Error: The graph is not chordal." << endl; cout << "VES: "; // Output vertex elimination scheme so user can identify the error for (deque<int>::size_type f1 = 0; f1 < graph.size(); ++f1){ cout << VES[f1] << " "; cout << endl; return -1; else{ // COMPUTE THE MAXIMAL CLIQUES OF G USING VES (THE VERTEX ELIMINATION SCHEME) vector<set_advanced<int> > maximal_cliques; vector<bool> used2(n); for(int i = 0; i < N; ++i){ set_advanced<int> max_clique; for (int j = 0; j < N; ++j){ if ((graph[ves[i]][j] == 1 j == VES[i]) && used2[j] == 0){ max_clique.insert(j); maximal_cliques.push_back(max_clique); used2[ves[i]] = 1; for(vector<int>::size_type i = 0; i < maximal_cliques.size()-1; ++i){ if(maximal_cliques[i].subset(maximal_cliques[i+1])){ // Remove non-maximal cliques at end of VES. maximal_cliques.erase(maximal_cliques.begin()+i+1); i--; 30

34 const int M = maximal_cliques.size(); cout << "Maximal Cliques:" << endl; // Print maximal cliques for (vector<int>::size_type x = 0; x < maximal_cliques.size(); ++x){ for (set_advanced<int>::iterator y = maximal_cliques[x].begin(); y!= maximal_cliques[x].end(); ++y){ cout << *y << " "; cout << endl; // CALCULATE THE REDUCED CLIQUE GRAPH OF G vector<vector<set_advanced<int> > > reduced_clique_graph; // Initialise reduced clique graph. for (vector<int>::size_type i = 0; i < maximal_cliques.size(); ++i){ vector<set_advanced<int> > vect; for (vector<int>::size_type j = 0; j < maximal_cliques.size(); ++j){ set_advanced<int> Aset; vect.push_back(aset); reduced_clique_graph.push_back(vect); for (vector<int>::size_type i = 0; i < maximal_cliques.size(); ++i){ // Create matrix with ALL separators. This is NOT YET the reduced clique graph. for (vector<int>::size_type j = maximal_cliques.size()-1; j > i; --j){ for (set_advanced<int>::iterator k = maximal_cliques[i].begin(); k!= maximal_cliques[i].end(); ++k){ for (set_advanced<int>::iterator l = maximal_cliques[j].begin(); l!= maximal_cliques[j].end(); ++l){ if(*k == *l){ reduced_clique_graph[i][j].insert(*k); reduced_clique_graph[j][i].insert(*k); vector<set_advanced<int> > separators; set_advanced<int> null; // The set in reduced_clique_graph[i][j] when there is no edge between the maximal cliques // C_i and C_j for (vector<int>::size_type i = 0; i < reduced_clique_graph.size(); ++i){ for (vector<int>::size_type j = 0; j < reduced_clique_graph[i].size(); ++j){ bool flag = 1; for (vector<int>::size_type k = 0; k < separators.size(); ++k){ // This makes sure we don t add the same separator twice if (reduced_clique_graph[i][j] == separators[k]){ flag = 0; if (flag == 1 && reduced_clique_graph[i][j]!= null){ separators.push_back(reduced_clique_graph[i][j]); for(vector<int>::size_type i = separators.size()-1; i > 0; --i){// Bubble sort the separators for(vector<int>::size_type j = 0; j < i; ++j){ if(separators[j].size() > separators[j+1].size()){ set_advanced<int> temp = separators[j]; separators[j] = separators[j+1]; separators[j+1] = temp; 31

35 // Form the minimal separator graphs to identify edges of the reduced clique graph // (see Theorem 1) vector<vector<set_advanced<int> > > minimal_separator_components; for(vector<int>::size_type i = 0; i < separators.size(); ++i){ vector<set_advanced<int> > H;//create H for (vector<int>::size_type j = 0; j < maximal_cliques.size(); ++j){ if(maximal_cliques[j].subset(separators[i])){ H.push_back(maximal_cliques[j]); vector<set_advanced<int> > H_components; // Used to test connectivity H_components.push_back(H[0]); // Test conectivity for(vector<int>::size_type k = 1; k < H.size(); ++k){ bool flag = 1; for(vector<int>::size_type l = 0; l < H_components.size(); ++l){ if(set_advanced<int>::intersection(h[k],h_components[l])!= separators[i]){ H_components[l] = set_advanced<int>::set_union(h_components[l],h[k]); flag = 0; if (flag == 1){ H_components.push_back(H[k]); for(vector<int>::size_type m = H_components.size()-1; m > 0; --m){ bool flag = 0; for(vector<int>::size_type n = 0; n < m; ++n){ if(set_advanced<int>::intersection(h_components[m],h_components[n])!= separators[i]){ H_components[n] = set_advanced<int>::set_union(h_components[m],h_components[n]); flag = 1; if(flag == 1){ vector<set_advanced<int> >::iterator e = H_components.begin() + m; H_components.erase(e); minimal_separator_components.push_back(h_components); for(vector<int>::size_type p = 0; p < maximal_cliques.size()-1; ++p){ for(vector<int>::size_type q = maximal_cliques.size()-1; q > p; --q){ if(set_advanced<int>::intersection(maximal_cliques[p],maximal_cliques[q]) == separators[i]){ for(vector<int>::size_type r = 0; r < H_components.size(); ++r){ if(h_components[r].subset(maximal_cliques[p]) && H_components[r].subset(maximal_cliques[q])){ reduced_clique_graph[p][q] = null; reduced_clique_graph[q][p] = null; // COMPUTE SOME CLIQUE TREE OF THE REDUCED CLIQUE GRAPH vector<int> cliques(maximal_cliques.size()); // Keeps track of which cliques have been used vector<int> done(maximal_cliques.size(),1); // Vector cliques should resemble done when task is complete vector<vector<set_advanced<int> > > tree; for(vector<int>::size_type i = 0; i < maximal_cliques.size(); ++i){ vector<set_advanced<int> > vect; for(vector<int>::size_type j = 0; j < maximal_cliques.size(); ++j){ 32

36 set_advanced<int> Aset; vect.push_back(aset); tree.push_back(vect); for(vector<int>::size_type i = 0; i < reduced_clique_graph.size(); ++i){ bool flag = 0; for(vector<int>::size_type j = 0; j < reduced_clique_graph.size(); ++j){ if(reduced_clique_graph[i][j] == separators[separators.size()-1]){ tree[i][j] = separators[separators.size()-1]; tree[j][i] = separators[separators.size()-1]; cliques[i] = cliques[j] = 1; flag = 1; break; if(flag == 1){ break; while(cliques!= done){ for(vector<int>::size_type i = separators.size()-1; i!= -1; --i){ for (vector<int>::size_type j = 0; j < maximal_cliques.size(); ++j){ if(cliques[j] == 0){ for(vector<int>::size_type k = 0; k < maximal_cliques.size(); ++k){ if(reduced_clique_graph[j][k] == separators[i] && cliques[k] == 1){ tree[j][k] = separators[i]; tree[k][j] = separators[i]; cliques[j] = 1; break; // WHILE THERE EXISTS A PATH IN THE UPCOMING DIGRAPH bool FLAG = 1; while(flag == 1){ FLAG = 0; vector<vector<set_advanced<int> > > tokens; // Finds which tokens each clique has for (vector<int>::size_type i = 0; i < tree.size(); ++i){ vector<set_advanced<int> > vect; tokens.push_back(vect); for(vector<int>::size_type i = 0; i < tree.size(); ++i){ for(vector<int>::size_type j = 0; j < tree.size(); ++j){ if(tree[i][j]!= null){ tokens[i].push_back(tree[i][j]); vector<int> degrees; // Important in finding paths from cliques of degree >= 3 to leaves for (vector<int>::size_type i = 0; i < tree.size(); ++i){ int degree = 0; for (vector<int>::size_type j = 0; j < tree.size(); ++j){ if(tree[i][j]!= null){ degree++; degrees.push_back(degree); vector<vector<vector<set_advanced<int> > > > digraph; // Initialise the Digraph 33

37 for (vector<int>::size_type i = 0; i < tree.size(); ++i){ vector<vector<set_advanced<int> > > vect1; for (vector<int>::size_type j = 0; j < tree.size(); ++j){ vector<set_advanced<int> > vect2; vect1.push_back(vect2); digraph.push_back(vect1); for(vector<int>::size_type i = 0; i < separators.size(); ++i){ // Construct the Digraph of current tree for(vector<int>::size_type j = 0; j < maximal_cliques.size(); ++j){ for(vector<int>::size_type k = 0; k < maximal_cliques.size(); ++k){ bool flag1 = 0, flag2 = 0; int token_no = 0; for(vector<int>::size_type l = 0; l < tokens[j].size(); ++l){ if(tokens[j][l]==separators[i]){ flag1 = 1; token_no++; if(token_no > 1){ flag2 = 1; set_advanced<int> K; for(vector<int>::size_type m = 0; m < minimal_separator_components[i].size(); ++m){ if(minimal_separator_components[i][m].subset(maximal_cliques[j])){ K = minimal_separator_components[i][m]; for(vector<int>::size_type n = 0; n < maximal_cliques.size(); ++n){ // Used in Propositions 7 (iv): exits C (C_n) in K that has token i if(maximal_cliques[n]!= maximal_cliques[j] && K.subset(maximal_cliques[n])){ for(vector<int>::size_type p = 0; p < tokens[n].size(); ++p){ if(tokens[n][p] == separators[i]){ flag2 = 1; if( flag1 == 1 && // C_j contains the token i (Proposition 7 (i)) maximal_cliques[j]!= maximal_cliques[k] && // C_j!= C_k maximal_cliques[j].subset(separators[i]) && maximal_cliques[k].subset(separators[i])&& // token i subest of both C_j and C_k(Proposition 7 (i)) degrees[j] >= 2 && //deg(c_j) > 1 (Proposition 7 (iii)) (K.subset(maximal_cliques[k])!K.subset(maximal_cliques[k]) && flag2 == 1)){ // Proposition 7 (iv) digraph[j][k].push_back(separators[i]); //SEARCH FOR A PATH IN THE DIGRAPH FROM A CENTRAL CLIQUE TO A LEAF vector<set_advanced<int> > null_vector; vector<int> null_vector_int; deque<int> empty_queue; vector<int> digraph_degrees; // deg_tau(c) for (vector<int>::size_type i = 0; i < digraph.size(); ++i){ int digraph_degree = 0; for (vector<int>::size_type j = 0; j < digraph.size(); ++j){ if(digraph[i][j]!= null_vector){ digraph_degree++; 34

38 digraph_degrees.push_back(digraph_degree); vector<int> starting_points; // Cliques of degree > 2 for(vector<int>::size_type i = 0; i < digraph.size(); ++i){ if(degrees[i] > 2){ starting_points.push_back(i); for(vector<int>::size_type j = 0; j < starting_points.size(); ++j){ vector<bool> visited(digraph.size()); vector<int> predecessors(digraph.size()); visited[starting_points[j]] = 1; deque<int> queue; queue.push_back(starting_points[j]); while(queue!= empty_queue){ if(degrees[queue[0]] == 1){ deque<int> path; // Build a path from starting point j int path_build = queue[0]; while(predecessors[path_build]!= 0){ path.push_front(path_build); path_build = predecessors[path_build]; path.push_front(starting_points[j]); for(vector<int>::size_type l = 0; l < path.size()-1; ++l){ // Update digraph for(vector<int>::size_type m = 0; m < tree.size(); ++m){ if(tree[path[l]][m] == digraph[path[l]][path[l+1]][0] && m!= path[l+1]){ tree[m][path[l+1]] = tree[path[l]][m]; tree[path[l+1]][m] = tree[path[l]][m]; tree[path[l]][m] = null; tree[m][path[l]] = null; break; FLAG = 1; for(vector<int>::size_type k = 0; k < digraph.size(); ++k){ if(digraph[queue[0]][k]!= null_vector && visited[k] == 0){ visited[k] = 1; predecessors[k] = queue[0]; queue.push_back(k); queue.pop_front(); if(flag == 1){ queue = empty_queue; // OUTPUT THE CLIQUE TREE AND THE LEAFAGE cout << "Clique Tree:" << endl; // Output the clique tree with minimal leafage. for (vector<int>::size_type x = 0; x < tree.size(); ++x){ cout << " "; for (vector<int>::size_type y = 0; y < tree[x].size(); ++y){ for (set_advanced<int>::iterator z = tree[x][y].begin(); z!= tree[x][y].end(); ++z){ cout << *z; cout << " "; cout << endl; 35

39 vector<int> final_degrees; // Calculate the degrees of the final clique tree for (vector<int>::size_type i = 0; i < tree.size(); ++i){ int degree = 0; for (vector<int>::size_type j = 0; j < tree.size(); ++j){ if(tree[i][j]!= null){ degree++; final_degrees.push_back(degree); int leafage = 0; // Calculate the leafage for(vector<int>::size_type i = 0; i < final_degrees.size(); ++i){ if(final_degrees[i] == 1){ leafage++; cout << "The leafage is " << leafage << "." << endl; return 0; C.4 Keil s Algorithm to Check Hamiltonicity in Interval Graphs /****FOLLOWS FROM LEAFAGE ALGORITHM****/ if (leafage > 2){ // Error if leafage > 2 cout << "Error: The graph is not an interval graph." << endl; return -1; // ORDER THE MAXIMAL CLIQUES vector<set_advanced<int> > ordered_cliques; vector<int> used_cliques(m); vector<int>::size_type place; for(vector<int>::size_type i = 0; i < M; ++i){ if(final_degrees[i] == 1){ ordered_cliques.push_back(maximal_cliques[i]); place = i; used_cliques[i] = 1; break; for(vector<int>::size_type i = 0; i < M-1; ++i){ for(vector<int>::size_type j = 0; j < M; ++j){ if(tree[place][j]!= null && used_cliques[j] == 0){ // Use outputted clique tree to do this ordered_cliques.push_back(maximal_cliques[j]); place = j; used_cliques[j] = 1; break; cout << "Ordered Cliques:" << endl; // Print the cliques with new ordering for (vector<int>::size_type x = 0; x < ordered_cliques.size(); ++x){ cout << "C_" << x <<": "; for (set_advanced<int>::iterator y = ordered_cliques[x].begin(); y!= ordered_cliques[x].end(); ++y){ cout << *y << " "; cout << endl; 36

40 vector<vector<int> > ordered_clique_vector; // Change the data type to be easier to deal with for (vector<int>::size_type x = 0; x < M; ++x){ vector<int> clique_vector; for (set_advanced<int>::iterator y = ordered_cliques[x].begin(); y!= ordered_cliques[x].end(); ++y){ clique_vector.push_back(*y); ordered_clique_vector.push_back(clique_vector); // CALCULATE LEVEL(v) FOR ALL EACH VERTEX vector<int> levels; for(int v = 0; v < N; ++v){ set_advanced<int> S; S.insert(v); int v_level = 0; for(vector<int>::size_type i = 0; i < M; ++i){ if(ordered_cliques[i].subset(s) && i > v_level){ v_level = i; levels.push_back(v_level); // FIND THE CONDUCTORS FOR EACH MAXIMAL CLIQUE vector<vector<int> > conductors(m-1); for(vector<int>::size_type i = 0; i < M-1; ++i){ for(int v = 0; v < N; ++v){ set_advanced<int> S; S.insert(v); if(ordered_cliques[i].subset(s) && ordered_cliques[i+1].subset(s)){ conductors[i].push_back(v); if(conductors[0].size() < 2){ // If the first clique has less than 2 connductors, the graph is not Hamiltonian. cout << "The interval graph has no Hamiltonian Circuit" << endl << "Error in Case 1" << endl; return -1; // CHOOSE THE CONDUCTORS A AND B vector<int> AB;// The first two conductors of the Hamiltonian Path AB.push_back(conductors[0][0]); AB.push_back(conductors[0][1]); for(vector<int>::size_type i = 2; i < conductors[0].size(); ++i){ bool flag = 0; if(levels[conductors[0][i]] < levels[conductors[0][0]]){ AB[0] = conductors[0][i]; flag = 1; if(levels[conductors[0][i]] < levels[conductors[0][1]] && flag == 0){ AB[1] = conductors[0][i]; if(levels[ab[1]] < levels[ab[0]]){ // Make A the conductor of lower level int temp = AB[1]; AB[1] = AB[0]; AB[0] = temp; // START BUILDING TH POTENTIAL HAMILTONIAN PATH deque<int> Hamiltonian_Path; 37

41 vector<bool> labelled(n); // Keep track of used vertices in the path Hamiltonian_Path.push_back(AB[0]); labelled[ab[0]] = 1; for(vector<int>::size_type i = 0; i < ordered_clique_vector[0].size(); ++i){ if(levels[ordered_clique_vector[0][i]] == 0){ Hamiltonian_Path.push_back(ordered_clique_vector[0][i]); labelled[ordered_clique_vector[0][i]] = 1; Hamiltonian_Path.push_back(AB[1]); labelled[ab[1]] = 1; // FIND NEW CONDUCTORS WHEN NECCESSARY FOR EACH CLIQUE OF G for(int i = 1; i < M-1; ++i){ if(levels[ab[0]] == i levels[ab[1]] == i){ if(levels[ab[0]] == i){ bool FAIL = 1; for(vector<int>::size_type j = 0; j < conductors[i].size(); ++j){ // Find a replacement conductor of C_i for A if(levels[conductors[i][j]] > levels[ab[0]] && labelled[conductors[i][j]] == 0){ AB[0] = conductors[i][j]; FAIL = 0; break; if(fail == 1){ // Check for failure by case 2(a) cout << "The graph has no Hamiltonian Circuit" << endl << "Error in Case 2(a)" << endl; return -1; for(vector<int>::size_type k = 0; k < conductors[i].size(); ++k){// minimise A if(levels[conductors[i][k]] < levels[ab[0]] && labelled[conductors[i][k]] == 0){ AB[0] = conductors[i][k]; for(vector<int>::size_type l = 0; l < ordered_clique_vector[i].size(); ++l){ // Take path through all other unused vertices if(levels[ordered_clique_vector[i][l]] == i && labelled[ordered_clique_vector[i][l]] == 0){ Hamiltonian_Path.push_front(ordered_clique_vector[i][l]); labelled[ordered_clique_vector[i][l]] = 1; Hamiltonian_Path.push_front(AB[0]); labelled[ab[0]] = 1; if(levels[ab[1]] == i){ bool FAIL = 1; for(vector<int>::size_type m = 0; m < conductors[i].size(); ++m){ // Find a replacement conductor of C_i for B if(levels[conductors[i][m]] > levels[ab[1]] && labelled[conductors[i][m]] == 0){ AB[1] = conductors[i][m]; FAIL = 0; break; if(fail == 1){ // Check for failure by case 2(a) cout << "The graph has no Hamiltonian Circuit" << endl << "Error in Case 2(a)" << endl; return -1; for(vector<int>::size_type n = 0; n < conductors[i].size(); ++n){// Minimise B if(levels[conductors[i][n]] < levels[ab[1]] && labelled[conductors[i][n]] == 0){ AB[1] = conductors[i][n]; Hamiltonian_Path.push_back(AB[1]); labelled[ab[1]] = 1; 38

42 if(levels[ab[1]] < levels[ab[0]]){ int temp = AB[1]; AB[1] = AB[0]; AB[0] = temp; bool case2 = 0; for(vector<int>::size_type j = 0; j < ordered_clique_vector[i].size(); ++j){// flag up case 2 if(labelled[ordered_clique_vector[i][j]] == 0){ case2 = 1; if(levels[ab[0]] > i && levels[ab[1]] > i && case2 == 1){ bool FAIL = 1; for(vector<int>::size_type k = 0; k < conductors[i].size(); ++k){ // Find a replacement conductor of C_i for A if(labelled[conductors[i][k]] == 0){ // level of this conductor is at least i (infact greater than as it was minimal) // so no need to check AB[0] = conductors[i][k]; labelled[conductors[i][k]] = 1; FAIL = 0; break; if(fail == 1){ // Check for failure by case 2(b) cout << "The graph has no Hamiltonian Circuit" << endl << "Error in Case2 (b)" << endl; return -1; for(vector<int>::size_type l = 0; l < ordered_clique_vector[i].size(); ++l){ if(labelled[ordered_clique_vector[i][l]] == 0){ Hamiltonian_Path.push_front(ordered_clique_vector[i][l]); labelled[ordered_clique_vector[i][l]]= 1; Hamiltonian_Path.push_front(AB[0]); // COMPLETE CYCLE IN THE LAST CLIQUE for(vector<int>::size_type i = 0; i < ordered_clique_vector[m-1].size(); ++i){ if(labelled[ordered_clique_vector[m-1][i]] == 0){ Hamiltonian_Path.push_front(ordered_clique_vector[M-1][i]); Hamiltonian_Path.push_back(Hamiltonian_Path[0]); // OUTPUT THE CYCLE OBTAINED cout << "The interval graph is Hamiltonian." << endl << "One such circuit is: "; // Print the result for(vector<int>::size_type x = 0; x < Hamiltonian_Path.size(); ++x){ cout << Hamiltonian_Path[x] << " "; cout << endl; return 0; References [1] K.S. Booth and G.S. Lueker, Testing for the consecutive ones property, interval graphs, and graph planarity using PQ-tree algorithms, Journal of Computer and System Sciences 39

43 13 (1976), [2] D.R. Fulkerson and O.A. Gross, Incidence matrices and interval graphs, Pacific Journal of Mathematics 15 (1965), [3] F. Gavril, The Intersection graphs of subtrees in trees are exactly the chordal graphs, Journal of Combinatorial Theory (B) 16 (1973), [4] M.C. Golumbic, Algorithmic Graph Theory and Perfect Graphs, Second edition, Annals of Discrete Mathematics 57 Elsevier (2004). [5] M. Habib and J. Stacho, Polynomial-time algorithm for the leafage of chordal graphs, Lecture Notes in Computer Science 5757 (2009), [6] J.M. Keil, Finding Hamiltonian circuits in interval graphs, Information Processing Letters 20 (1985), [7] R.M. Karp, Reducibility among combinatorial problems, in: R.E. Miller and J.W. Thatcher (editors), Complexity of Computer Computations, Plenum Press, New York (1972), [8] C. Lekkerkerker and D. Boland, Representation of finite graphs by a set of intervals on the line, Fundamenta Mathematicae 51 (1962), [9] I. Lin, T.A. McKee and D.B. West, The leafage of a chordal graph, Discussiones Mathematicae Graph Theory 18 (1998), [10] D.J. Rose, R.E. Tarjan and G.S. Lueker, Algorithmic aspects of vertex elimination on graphs, SIAM Journal of Computing 5 (1976),

44

45

46

Fundamental Properties of Graphs

Fundamental Properties of Graphs Chapter three In many real-life situations we need to know how robust a graph that represents a certain network is, how edges or vertices can be removed without completely destroying the overall connectivity,

More information

A Decomposition for Chordal graphs and Applications

A Decomposition for Chordal graphs and Applications A Decomposition for Chordal graphs and Applications Michel Habib Joint work with Vincent Limouzy and Juraj Stacho Pretty Structure, Existencial Polytime Jack Edmonds Birthday, 7-9 april 2009 Schedule Chordal

More information

Faster parameterized algorithms for Minimum Fill-In

Faster parameterized algorithms for Minimum Fill-In Faster parameterized algorithms for Minimum Fill-In Hans L. Bodlaender Pinar Heggernes Yngve Villanger Abstract We present two parameterized algorithms for the Minimum Fill-In problem, also known as Chordal

More information

Faster parameterized algorithms for Minimum Fill-In

Faster parameterized algorithms for Minimum Fill-In Faster parameterized algorithms for Minimum Fill-In Hans L. Bodlaender Pinar Heggernes Yngve Villanger Technical Report UU-CS-2008-042 December 2008 Department of Information and Computing Sciences Utrecht

More information

Last course. Last course. Michel Habib 28 octobre 2016

Last course. Last course. Michel Habib  28 octobre 2016 Last course Michel Habib habib@irif.fr http://www.irif.fr/~habib 28 octobre 2016 Schedule Introduction More structural insights on chordal graphs Properties of reduced clique graphs Exercises Interval

More information

Chordal Graphs: Theory and Algorithms

Chordal Graphs: Theory and Algorithms Chordal Graphs: Theory and Algorithms 1 Chordal graphs Chordal graph : Every cycle of four or more vertices has a chord in it, i.e. there is an edge between two non consecutive vertices of the cycle. Also

More information

Bipartite Roots of Graphs

Bipartite Roots of Graphs Bipartite Roots of Graphs Lap Chi Lau Department of Computer Science University of Toronto Graph H is a root of graph G if there exists a positive integer k such that x and y are adjacent in G if and only

More information

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings On the Relationships between Zero Forcing Numbers and Certain Graph Coverings Fatemeh Alinaghipour Taklimi, Shaun Fallat 1,, Karen Meagher 2 Department of Mathematics and Statistics, University of Regina,

More information

Chapter 11: Graphs and Trees. March 23, 2008

Chapter 11: Graphs and Trees. March 23, 2008 Chapter 11: Graphs and Trees March 23, 2008 Outline 1 11.1 Graphs: An Introduction 2 11.2 Paths and Circuits 3 11.3 Matrix Representations of Graphs 4 11.5 Trees Graphs: Basic Definitions Informally, a

More information

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises...

Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises... Modules 6 Hamilton Graphs (4-8 lectures) 135 6.1 Introduction................................ 136 6.2 Necessary conditions and sufficient conditions............. 137 Exercises..................................

More information

Chordal graphs MPRI

Chordal graphs MPRI Chordal graphs MPRI 2017 2018 Michel Habib habib@irif.fr http://www.irif.fr/~habib Sophie Germain, septembre 2017 Schedule Chordal graphs Representation of chordal graphs LBFS and chordal graphs More structural

More information

6. Lecture notes on matroid intersection

6. Lecture notes on matroid intersection Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans May 2, 2017 6. Lecture notes on matroid intersection One nice feature about matroids is that a simple greedy algorithm

More information

Vertex 3-colorability of claw-free graphs

Vertex 3-colorability of claw-free graphs Algorithmic Operations Research Vol.2 (27) 5 2 Vertex 3-colorability of claw-free graphs Marcin Kamiński a Vadim Lozin a a RUTCOR - Rutgers University Center for Operations Research, 64 Bartholomew Road,

More information

1 Matchings in Graphs

1 Matchings in Graphs Matchings in Graphs J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 Definition Two edges are called independent if they are not adjacent

More information

Matching Theory. Figure 1: Is this graph bipartite?

Matching Theory. Figure 1: Is this graph bipartite? Matching Theory 1 Introduction A matching M of a graph is a subset of E such that no two edges in M share a vertex; edges which have this property are called independent edges. A matching M is said to

More information

THE LEAFAGE OF A CHORDAL GRAPH

THE LEAFAGE OF A CHORDAL GRAPH Discussiones Mathematicae Graph Theory 18 (1998 ) 23 48 THE LEAFAGE OF A CHORDAL GRAPH In-Jen Lin National Ocean University, Taipei, Taiwan Terry A. McKee 1 Wright State University, Dayton, OH 45435-0001,

More information

Introduction III. Graphs. Motivations I. Introduction IV

Introduction III. Graphs. Motivations I. Introduction IV Introduction I Graphs Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Graph theory was introduced in the 18th century by Leonhard Euler via the Königsberg

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

The External Network Problem

The External Network Problem The External Network Problem Jan van den Heuvel and Matthew Johnson CDAM Research Report LSE-CDAM-2004-15 December 2004 Abstract The connectivity of a communications network can often be enhanced if the

More information

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ - artale/z

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ -  artale/z CHAPTER 10 GRAPHS AND TREES Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/z SECTION 10.1 Graphs: Definitions and Basic Properties Copyright Cengage Learning. All rights reserved. Graphs: Definitions

More information

Introduction to Graph Theory

Introduction to Graph Theory Introduction to Graph Theory Tandy Warnow January 20, 2017 Graphs Tandy Warnow Graphs A graph G = (V, E) is an object that contains a vertex set V and an edge set E. We also write V (G) to denote the vertex

More information

Module 11. Directed Graphs. Contents

Module 11. Directed Graphs. Contents Module 11 Directed Graphs Contents 11.1 Basic concepts......................... 256 Underlying graph of a digraph................ 257 Out-degrees and in-degrees.................. 258 Isomorphism..........................

More information

2. CONNECTIVITY Connectivity

2. CONNECTIVITY Connectivity 2. CONNECTIVITY 70 2. Connectivity 2.1. Connectivity. Definition 2.1.1. (1) A path in a graph G = (V, E) is a sequence of vertices v 0, v 1, v 2,..., v n such that {v i 1, v i } is an edge of G for i =

More information

On 2-Subcolourings of Chordal Graphs

On 2-Subcolourings of Chordal Graphs On 2-Subcolourings of Chordal Graphs Juraj Stacho School of Computing Science, Simon Fraser University 8888 University Drive, Burnaby, B.C., Canada V5A 1S6 jstacho@cs.sfu.ca Abstract. A 2-subcolouring

More information

Assignment 4 Solutions of graph problems

Assignment 4 Solutions of graph problems Assignment 4 Solutions of graph problems 1. Let us assume that G is not a cycle. Consider the maximal path in the graph. Let the end points of the path be denoted as v 1, v k respectively. If either of

More information

K 4 C 5. Figure 4.5: Some well known family of graphs

K 4 C 5. Figure 4.5: Some well known family of graphs 08 CHAPTER. TOPICS IN CLASSICAL GRAPH THEORY K, K K K, K K, K K, K C C C C 6 6 P P P P P. Graph Operations Figure.: Some well known family of graphs A graph Y = (V,E ) is said to be a subgraph of a graph

More information

Number Theory and Graph Theory

Number Theory and Graph Theory 1 Number Theory and Graph Theory Chapter 7 Graph properties By A. Satyanarayana Reddy Department of Mathematics Shiv Nadar University Uttar Pradesh, India E-mail: satya8118@gmail.com 2 Module-2: Eulerian

More information

9 About Intersection Graphs

9 About Intersection Graphs 9 About Intersection Graphs Since this lecture we focus on selected detailed topics in Graph theory that are close to your teacher s heart... The first selected topic is that of intersection graphs, i.e.

More information

These notes present some properties of chordal graphs, a set of undirected graphs that are important for undirected graphical models.

These notes present some properties of chordal graphs, a set of undirected graphs that are important for undirected graphical models. Undirected Graphical Models: Chordal Graphs, Decomposable Graphs, Junction Trees, and Factorizations Peter Bartlett. October 2003. These notes present some properties of chordal graphs, a set of undirected

More information

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions Introduction Chapter 9 Graph Algorithms graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 2 Definitions an undirected graph G = (V, E) is

More information

Chapter 9 Graph Algorithms

Chapter 9 Graph Algorithms Chapter 9 Graph Algorithms 2 Introduction graph theory useful in practice represent many real-life problems can be slow if not careful with data structures 3 Definitions an undirected graph G = (V, E)

More information

Number Theory and Graph Theory

Number Theory and Graph Theory 1 Number Theory and Graph Theory Chapter 6 Basic concepts and definitions of graph theory By A. Satyanarayana Reddy Department of Mathematics Shiv Nadar University Uttar Pradesh, India E-mail: satya8118@gmail.com

More information

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities?

How can we lay cable at minimum cost to make every telephone reachable from every other? What is the fastest route between two given cities? 1 Introduction Graph theory is one of the most in-demand (i.e. profitable) and heavily-studied areas of applied mathematics and theoretical computer science. May graph theory questions are applied in this

More information

Chapter 3. Set Theory. 3.1 What is a Set?

Chapter 3. Set Theory. 3.1 What is a Set? Chapter 3 Set Theory 3.1 What is a Set? A set is a well-defined collection of objects called elements or members of the set. Here, well-defined means accurately and unambiguously stated or described. Any

More information

Basics of Graph Theory

Basics of Graph Theory Basics of Graph Theory 1 Basic notions A simple graph G = (V, E) consists of V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements of V called edges. Simple graphs have their

More information

Extremal Graph Theory: Turán s Theorem

Extremal Graph Theory: Turán s Theorem Bridgewater State University Virtual Commons - Bridgewater State University Honors Program Theses and Projects Undergraduate Honors Program 5-9-07 Extremal Graph Theory: Turán s Theorem Vincent Vascimini

More information

2 The Fractional Chromatic Gap

2 The Fractional Chromatic Gap C 1 11 2 The Fractional Chromatic Gap As previously noted, for any finite graph. This result follows from the strong duality of linear programs. Since there is no such duality result for infinite linear

More information

Elements of Graph Theory

Elements of Graph Theory Elements of Graph Theory Quick review of Chapters 9.1 9.5, 9.7 (studied in Mt1348/2008) = all basic concepts must be known New topics we will mostly skip shortest paths (Chapter 9.6), as that was covered

More information

On Universal Cycles of Labeled Graphs

On Universal Cycles of Labeled Graphs On Universal Cycles of Labeled Graphs Greg Brockman Harvard University Cambridge, MA 02138 United States brockman@hcs.harvard.edu Bill Kay University of South Carolina Columbia, SC 29208 United States

More information

The Structure of Bull-Free Perfect Graphs

The Structure of Bull-Free Perfect Graphs The Structure of Bull-Free Perfect Graphs Maria Chudnovsky and Irena Penev Columbia University, New York, NY 10027 USA May 18, 2012 Abstract The bull is a graph consisting of a triangle and two vertex-disjoint

More information

A NEW TEST FOR INTERVAL GRAPHS. Wen-Lian Hsu 1

A NEW TEST FOR INTERVAL GRAPHS. Wen-Lian Hsu 1 A NEW TEST FOR INTERVAL GRAPHS Wen-Lian Hsu 1 Institute of Information Science, Academia Sinica Taipei, Taiwan, Republic of China hsu@iis.sinica.edu.tw Abstract An interval graph is the intersection graph

More information

An Eternal Domination Problem in Grids

An Eternal Domination Problem in Grids Theory and Applications of Graphs Volume Issue 1 Article 2 2017 An Eternal Domination Problem in Grids William Klostermeyer University of North Florida, klostermeyer@hotmail.com Margaret-Ellen Messinger

More information

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge.

Adjacent: Two distinct vertices u, v are adjacent if there is an edge with ends u, v. In this case we let uv denote such an edge. 1 Graph Basics What is a graph? Graph: a graph G consists of a set of vertices, denoted V (G), a set of edges, denoted E(G), and a relation called incidence so that each edge is incident with either one

More information

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions Basic Combinatorics Math 40210, Section 01 Fall 2012 Homework 4 Solutions 1.4.2 2: One possible implementation: Start with abcgfjiea From edge cd build, using previously unmarked edges: cdhlponminjkghc

More information

Graph Theory. Connectivity, Coloring, Matching. Arjun Suresh 1. 1 GATE Overflow

Graph Theory. Connectivity, Coloring, Matching. Arjun Suresh 1. 1 GATE Overflow Graph Theory Connectivity, Coloring, Matching Arjun Suresh 1 1 GATE Overflow GO Classroom, August 2018 Thanks to Subarna/Sukanya Das for wonderful figures Arjun, Suresh (GO) Graph Theory GATE 2019 1 /

More information

Paths, Flowers and Vertex Cover

Paths, Flowers and Vertex Cover Paths, Flowers and Vertex Cover Venkatesh Raman M. S. Ramanujan Saket Saurabh Abstract It is well known that in a bipartite (and more generally in a König) graph, the size of the minimum vertex cover is

More information

Figure 2.1: A bipartite graph.

Figure 2.1: A bipartite graph. Matching problems The dance-class problem. A group of boys and girls, with just as many boys as girls, want to dance together; hence, they have to be matched in couples. Each boy prefers to dance with

More information

Contracting Chordal Graphs and Bipartite Graphs to Paths and Trees

Contracting Chordal Graphs and Bipartite Graphs to Paths and Trees Contracting Chordal Graphs and Bipartite Graphs to Paths and Trees Pinar Heggernes Pim van t Hof Benjamin Léveque Christophe Paul Abstract We study the following two graph modification problems: given

More information

Simple Graph. General Graph

Simple Graph. General Graph Graph Theory A graph is a collection of points (also called vertices) and lines (also called edges), with each edge ending at a vertex In general, it is allowed for more than one edge to have the same

More information

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur Lecture : Graphs Rajat Mittal IIT Kanpur Combinatorial graphs provide a natural way to model connections between different objects. They are very useful in depicting communication networks, social networks

More information

Graph Connectivity G G G

Graph Connectivity G G G Graph Connectivity 1 Introduction We have seen that trees are minimally connected graphs, i.e., deleting any edge of the tree gives us a disconnected graph. What makes trees so susceptible to edge deletions?

More information

Treewidth and graph minors

Treewidth and graph minors Treewidth and graph minors Lectures 9 and 10, December 29, 2011, January 5, 2012 We shall touch upon the theory of Graph Minors by Robertson and Seymour. This theory gives a very general condition under

More information

Binary Relations McGraw-Hill Education

Binary Relations McGraw-Hill Education Binary Relations A binary relation R from a set A to a set B is a subset of A X B Example: Let A = {0,1,2} and B = {a,b} {(0, a), (0, b), (1,a), (2, b)} is a relation from A to B. We can also represent

More information

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) January 11, 2018 Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 In this lecture

More information

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Greedy Algorithms (continued) The best known application where the greedy algorithm is optimal is surely

More information

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY KARL L. STRATOS Abstract. The conventional method of describing a graph as a pair (V, E), where V and E repectively denote the sets of vertices and edges,

More information

Chapter 3: Paths and Cycles

Chapter 3: Paths and Cycles Chapter 3: Paths and Cycles 5 Connectivity 1. Definitions: Walk: finite sequence of edges in which any two consecutive edges are adjacent or identical. (Initial vertex, Final vertex, length) Trail: walk

More information

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition. 18.433 Combinatorial Optimization Matching Algorithms September 9,14,16 Lecturer: Santosh Vempala Given a graph G = (V, E), a matching M is a set of edges with the property that no two of the edges have

More information

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph Graphs and Trees Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) who is connected to whom Web search views web pages as a graph Who points to whom Niche graphs (Ecology):

More information

Characterizing Graphs (3) Characterizing Graphs (1) Characterizing Graphs (2) Characterizing Graphs (4)

Characterizing Graphs (3) Characterizing Graphs (1) Characterizing Graphs (2) Characterizing Graphs (4) S-72.2420/T-79.5203 Basic Concepts 1 S-72.2420/T-79.5203 Basic Concepts 3 Characterizing Graphs (1) Characterizing Graphs (3) Characterizing a class G by a condition P means proving the equivalence G G

More information

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19:

CS270 Combinatorial Algorithms & Data Structures Spring Lecture 19: CS270 Combinatorial Algorithms & Data Structures Spring 2003 Lecture 19: 4.1.03 Lecturer: Satish Rao Scribes: Kevin Lacker and Bill Kramer Disclaimer: These notes have not been subjected to the usual scrutiny

More information

Chordal deletion is fixed-parameter tractable

Chordal deletion is fixed-parameter tractable Chordal deletion is fixed-parameter tractable Dániel Marx Institut für Informatik, Humboldt-Universität zu Berlin, Unter den Linden 6, 10099 Berlin, Germany. dmarx@informatik.hu-berlin.de Abstract. It

More information

1 Matchings with Tutte s Theorem

1 Matchings with Tutte s Theorem 1 Matchings with Tutte s Theorem Last week we saw a fairly strong necessary criterion for a graph to have a perfect matching. Today we see that this condition is in fact sufficient. Theorem 1 (Tutte, 47).

More information

CLAW-FREE 3-CONNECTED P 11 -FREE GRAPHS ARE HAMILTONIAN

CLAW-FREE 3-CONNECTED P 11 -FREE GRAPHS ARE HAMILTONIAN CLAW-FREE 3-CONNECTED P 11 -FREE GRAPHS ARE HAMILTONIAN TOMASZ LUCZAK AND FLORIAN PFENDER Abstract. We show that every 3-connected claw-free graph which contains no induced copy of P 11 is hamiltonian.

More information

arxiv: v1 [cs.ds] 8 Jan 2019

arxiv: v1 [cs.ds] 8 Jan 2019 Subset Feedback Vertex Set in Chordal and Split Graphs Geevarghese Philip 1, Varun Rajan 2, Saket Saurabh 3,4, and Prafullkumar Tale 5 arxiv:1901.02209v1 [cs.ds] 8 Jan 2019 1 Chennai Mathematical Institute,

More information

The Encoding Complexity of Network Coding

The Encoding Complexity of Network Coding The Encoding Complexity of Network Coding Michael Langberg Alexander Sprintson Jehoshua Bruck California Institute of Technology Email: mikel,spalex,bruck @caltech.edu Abstract In the multicast network

More information

Graphs: Introduction. Ali Shokoufandeh, Department of Computer Science, Drexel University

Graphs: Introduction. Ali Shokoufandeh, Department of Computer Science, Drexel University Graphs: Introduction Ali Shokoufandeh, Department of Computer Science, Drexel University Overview of this talk Introduction: Notations and Definitions Graphs and Modeling Algorithmic Graph Theory and Combinatorial

More information

Math 443/543 Graph Theory Notes 11: Graph minors and Kuratowski s Theorem

Math 443/543 Graph Theory Notes 11: Graph minors and Kuratowski s Theorem Math 443/543 Graph Theory Notes 11: Graph minors and Kuratowski s Theorem David Glickenstein November 26, 2008 1 Graph minors Let s revisit some de nitions. Let G = (V; E) be a graph. De nition 1 Removing

More information

CMSC 380. Graph Terminology and Representation

CMSC 380. Graph Terminology and Representation CMSC 380 Graph Terminology and Representation GRAPH BASICS 2 Basic Graph Definitions n A graph G = (V,E) consists of a finite set of vertices, V, and a finite set of edges, E. n Each edge is a pair (v,w)

More information

3 No-Wait Job Shops with Variable Processing Times

3 No-Wait Job Shops with Variable Processing Times 3 No-Wait Job Shops with Variable Processing Times In this chapter we assume that, on top of the classical no-wait job shop setting, we are given a set of processing times for each operation. We may select

More information

Graph and Digraph Glossary

Graph and Digraph Glossary 1 of 15 31.1.2004 14:45 Graph and Digraph Glossary A B C D E F G H I-J K L M N O P-Q R S T U V W-Z Acyclic Graph A graph is acyclic if it contains no cycles. Adjacency Matrix A 0-1 square matrix whose

More information

Line Graphs and Circulants

Line Graphs and Circulants Line Graphs and Circulants Jason Brown and Richard Hoshino Department of Mathematics and Statistics Dalhousie University Halifax, Nova Scotia, Canada B3H 3J5 Abstract The line graph of G, denoted L(G),

More information

CPSC 536N: Randomized Algorithms Term 2. Lecture 10

CPSC 536N: Randomized Algorithms Term 2. Lecture 10 CPSC 536N: Randomized Algorithms 011-1 Term Prof. Nick Harvey Lecture 10 University of British Columbia In the first lecture we discussed the Max Cut problem, which is NP-complete, and we presented a very

More information

Interleaving Schemes on Circulant Graphs with Two Offsets

Interleaving Schemes on Circulant Graphs with Two Offsets Interleaving Schemes on Circulant raphs with Two Offsets Aleksandrs Slivkins Department of Computer Science Cornell University Ithaca, NY 14853 slivkins@cs.cornell.edu Jehoshua Bruck Department of Electrical

More information

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph. Trees 1 Introduction Trees are very special kind of (undirected) graphs. Formally speaking, a tree is a connected graph that is acyclic. 1 This definition has some drawbacks: given a graph it is not trivial

More information

MATH 363 Final Wednesday, April 28. Final exam. You may use lemmas and theorems that were proven in class and on assignments unless stated otherwise.

MATH 363 Final Wednesday, April 28. Final exam. You may use lemmas and theorems that were proven in class and on assignments unless stated otherwise. Final exam This is a closed book exam. No calculators are allowed. Unless stated otherwise, justify all your steps. You may use lemmas and theorems that were proven in class and on assignments unless stated

More information

Discrete mathematics , Fall Instructor: prof. János Pach

Discrete mathematics , Fall Instructor: prof. János Pach Discrete mathematics 2016-2017, Fall Instructor: prof. János Pach - covered material - Lecture 1. Counting problems To read: [Lov]: 1.2. Sets, 1.3. Number of subsets, 1.5. Sequences, 1.6. Permutations,

More information

Graph Theory Questions from Past Papers

Graph Theory Questions from Past Papers Graph Theory Questions from Past Papers Bilkent University, Laurence Barker, 19 October 2017 Do not forget to justify your answers in terms which could be understood by people who know the background theory

More information

Pebble Sets in Convex Polygons

Pebble Sets in Convex Polygons 2 1 Pebble Sets in Convex Polygons Kevin Iga, Randall Maddox June 15, 2005 Abstract Lukács and András posed the problem of showing the existence of a set of n 2 points in the interior of a convex n-gon

More information

Distributed minimum spanning tree problem

Distributed minimum spanning tree problem Distributed minimum spanning tree problem Juho-Kustaa Kangas 24th November 2012 Abstract Given a connected weighted undirected graph, the minimum spanning tree problem asks for a spanning subtree with

More information

5. Lecture notes on matroid intersection

5. Lecture notes on matroid intersection Massachusetts Institute of Technology Handout 14 18.433: Combinatorial Optimization April 1st, 2009 Michel X. Goemans 5. Lecture notes on matroid intersection One nice feature about matroids is that a

More information

Hamiltonian cycles in bipartite quadrangulations on the torus

Hamiltonian cycles in bipartite quadrangulations on the torus Hamiltonian cycles in bipartite quadrangulations on the torus Atsuhiro Nakamoto and Kenta Ozeki Abstract In this paper, we shall prove that every bipartite quadrangulation G on the torus admits a simple

More information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014 Suggested Reading: Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Probabilistic Modelling and Reasoning: The Junction

More information

arxiv: v5 [math.co] 5 Oct 2017

arxiv: v5 [math.co] 5 Oct 2017 Clique trees of infinite locally finite chordal graphs Christoph Hofer-Temmel and Florian Lehner arxiv:1311.7001v5 [math.co] 5 Oct 2017 Abstract We investigate clique trees of infinite locally finite chordal

More information

Clustering Using Graph Connectivity

Clustering Using Graph Connectivity Clustering Using Graph Connectivity Patrick Williams June 3, 010 1 Introduction It is often desirable to group elements of a set into disjoint subsets, based on the similarity between the elements in the

More information

Simpler, Linear-time Transitive Orientation via Lexicographic Breadth-First Search

Simpler, Linear-time Transitive Orientation via Lexicographic Breadth-First Search Simpler, Linear-time Transitive Orientation via Lexicographic Breadth-First Search Marc Tedder University of Toronto arxiv:1503.02773v1 [cs.ds] 10 Mar 2015 Abstract Comparability graphs are the undirected

More information

Small Survey on Perfect Graphs

Small Survey on Perfect Graphs Small Survey on Perfect Graphs Michele Alberti ENS Lyon December 8, 2010 Abstract This is a small survey on the exciting world of Perfect Graphs. We will see when a graph is perfect and which are families

More information

A Reduction of Conway s Thrackle Conjecture

A Reduction of Conway s Thrackle Conjecture A Reduction of Conway s Thrackle Conjecture Wei Li, Karen Daniels, and Konstantin Rybnikov Department of Computer Science and Department of Mathematical Sciences University of Massachusetts, Lowell 01854

More information

Applied Mathematics Letters. Graph triangulations and the compatibility of unrooted phylogenetic trees

Applied Mathematics Letters. Graph triangulations and the compatibility of unrooted phylogenetic trees Applied Mathematics Letters 24 (2011) 719 723 Contents lists available at ScienceDirect Applied Mathematics Letters journal homepage: www.elsevier.com/locate/aml Graph triangulations and the compatibility

More information

Basic Graph Theory with Applications to Economics

Basic Graph Theory with Applications to Economics Basic Graph Theory with Applications to Economics Debasis Mishra February 6, What is a Graph? Let N = {,..., n} be a finite set. Let E be a collection of ordered or unordered pairs of distinct elements

More information

Characterization of Super Strongly Perfect Graphs in Chordal and Strongly Chordal Graphs

Characterization of Super Strongly Perfect Graphs in Chordal and Strongly Chordal Graphs ISSN 0975-3303 Mapana J Sci, 11, 4(2012), 121-131 https://doi.org/10.12725/mjs.23.10 Characterization of Super Strongly Perfect Graphs in Chordal and Strongly Chordal Graphs R Mary Jeya Jothi * and A Amutha

More information

5 Matchings in Bipartite Graphs and Their Applications

5 Matchings in Bipartite Graphs and Their Applications 5 Matchings in Bipartite Graphs and Their Applications 5.1 Matchings Definition 5.1 A matching M in a graph G is a set of edges of G, none of which is a loop, such that no two edges in M have a common

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite

More information

9 Connectivity. Contents. 9.1 Vertex Connectivity

9 Connectivity. Contents. 9.1 Vertex Connectivity 9 Connectivity Contents 9.1 Vertex Connectivity.............................. 205 Connectivity and Local Connectivity............... 206 Vertex Cuts and Menger s Theorem................. 207 9.2 The Fan

More information

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 21 Dr. Ted Ralphs IE411 Lecture 21 1 Combinatorial Optimization and Network Flows In general, most combinatorial optimization and integer programming problems are

More information

3 Euler Tours, Hamilton Cycles, and Their Applications

3 Euler Tours, Hamilton Cycles, and Their Applications 3 Euler Tours, Hamilton Cycles, and Their Applications 3.1 Euler Tours and Applications 3.1.1 Euler tours Carefully review the definition of (closed) walks, trails, and paths from Section 1... Definition

More information

Chapter 3 Trees. Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.

Chapter 3 Trees. Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path. Chapter 3 Trees Section 3. Fundamental Properties of Trees Suppose your city is planning to construct a rapid rail system. They want to construct the most economical system possible that will meet the

More information

Section 3.1: Nonseparable Graphs Cut vertex of a connected graph G: A vertex x G such that G x is not connected. Theorem 3.1, p. 57: Every connected

Section 3.1: Nonseparable Graphs Cut vertex of a connected graph G: A vertex x G such that G x is not connected. Theorem 3.1, p. 57: Every connected Section 3.1: Nonseparable Graphs Cut vertex of a connected graph G: A vertex x G such that G x is not connected. Theorem 3.1, p. 57: Every connected graph G with at least 2 vertices contains at least 2

More information

On Covering a Graph Optimally with Induced Subgraphs

On Covering a Graph Optimally with Induced Subgraphs On Covering a Graph Optimally with Induced Subgraphs Shripad Thite April 1, 006 Abstract We consider the problem of covering a graph with a given number of induced subgraphs so that the maximum number

More information

Winning Positions in Simplicial Nim

Winning Positions in Simplicial Nim Winning Positions in Simplicial Nim David Horrocks Department of Mathematics and Statistics University of Prince Edward Island Charlottetown, Prince Edward Island, Canada, C1A 4P3 dhorrocks@upei.ca Submitted:

More information