Anda di halaman 1dari 4

Graph Theory

Assignment 1, due 6 February 15:00

Problem 1 The d-dimensional cube Sd is dened as follows: its vertex set is V (Sd ) = {0, 1}d (i.e. the set of all 0-1-sequences of length d), and two vertices are connected by an edge if and only if the corresponding sequences dier in exactly one position (i.e. S2 is a square, S3 a cube, etc.). a. Determine the number of edges of Sd . b. Show that Sd is Hamiltonian for every d 2. c. Show that Sd is d-connected. [Hint: use induction for b. and c.] Problem 2 a. Write a short Sage or Python programme that determines whether a given sequence is graphical or not. b. Test your function for the two sequences (6, 6, 6, 6, 4, 3, 3, 0) and (6, 5, 5, 4, 3, 3, 2, 2, 2). Problem 3 The eccentricity of a vertex v is the greatest distance between v and any other vertex. A centre of a graph G is a vertex of minimum eccentricity. This minimum eccentricity is called the radius r(G) of G. a. Determine all centres, the radius and the diameter of the graph below.

Figure 1: Problem 3a. b. Show: if d(G) denotes the diameter of G, then r(G) d(G) 2r(G).

Problem 4 The complement G of a graph G has the same vertex set as G, but xy is an edge in G if and only if xy is not an edge in G (see Figure 2).

Figure 2: A graph and its complement. a. Show: if G is disconnected, then G is connected. b. Show: if G has diameter > 3, then G has diameter < 3. c. A graph G is called self-complementary if G and G are isomorphic. Show: if a graph G on n vertices is self-complementary, then either n or n 1 is divisible by 4. Problem 5 The dual of a planar graph G is constructed as follows: each face in G is represented by a vertex, and for each edge e E(G) we draw an edge between the vertices that represent the faces which share the edge e (see Figure 3). The resulting graph may have multiple edges and loops. A graph is called self-dual if it is isomorphic to its dual.

Figure 3: A plane graph and its dual. a. Show that |E(G)| = 2|V (G)| 2 for every self-dual graph G. b. Provide an example of a self-dual graph with 6 vertices.

Graph Theory

Assignment 2, due 14 February 17:30

Problem 6 Consider Dijkstras algorithm on a graph where all edges have length 1. a. Show that every dw is changed only once. b. Explain how this observation allows to improve the speed of Dijkstras algorithm. c. Write a Sage programme which computes a shortest path between given vertices of a given graph under the unit length assumption. Here, you are not allowed to use functions on shortest paths already present in Sage, but you may of course use the general infrastructure (Graphs, edges, and so on.) d. Write a Sage programme which determines all connected components of an undirected graph, again without using the relevant functions. Problem 7 Give an example to show that Dijkstras Algorithm can give incorrect results if negative costs are allowed. Problem 8 Consider the following algorithm. Input: G = (V, E) directed graph, edge lengths e , vertex s Output: dv : length of the shortest path from s to v or failure. dv for v V \ {s}, ds 0, Pv undened for v V \ {s} i0 while i < |V | do c false for vw E do if dw > dv + vw then dw dv + vw Pw v c true end if end for if not(c) then Return(d, P ) end if ii+1 end while Return(failure) a. Prove that the algorithm returns failure if and only if there is a cycle of negative length in G.

b. Prove that, if there is no cycle of negative length in G, that the algorithm correctly yields shortest path lengths (and shortest paths via backtracking P ). c. Determine the worst case running time of the algorithm. d. Implement the algorithm in Sage. e. Test your implementation with graphs with non-negative edge-lengths and compare the result with Sages implementation of Dijkstras algorithm. f. Test your implementation with a graph which has some negative edge-lengths, but no negative cycle. Problem 9 Write a Sage programme determining a basis of the cycle space of a given oriented graph. Problem 10 Show, without using Mengers theorem or the max-ow-min-cut theorem, that any two vertices in a 2-vertex-connected graph lie on a common cycle.

Anda mungkin juga menyukai