0% found this document useful (0 votes)
45 views2 pages

02 FermetureTransitive-EN

This document contains an introduction to transitive closure and 5 exercises involving computing the transitive closure of graphs and applying it to problems. The exercises include examples of computing the transitive closure of graphs, properties of tau-equivalent graphs, algorithms for computing transitive closure including the Floyd-Warshall algorithm, and modeling a workshop layout problem as a graph problem.

Uploaded by

Hong Kimmeng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views2 pages

02 FermetureTransitive-EN

This document contains an introduction to transitive closure and 5 exercises involving computing the transitive closure of graphs and applying it to problems. The exercises include examples of computing the transitive closure of graphs, properties of tau-equivalent graphs, algorithms for computing transitive closure including the Floyd-Warshall algorithm, and modeling a workshop layout problem as a graph problem.

Uploaded by

Hong Kimmeng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Tutorial 2 : Transitive closure

Graph theory, 1st semester.


2022

Exercise 1 — Some examples and properties

Two graphs G and G′ are τ-equivalent if τ(G) = τ(G′ ). A partial graph G′ of G is τ-minimal
τ-équivalent to G if it is τ-equivalent to G and, if we remove an arc of G′ , we get a graph
that is not τ-equivalent to G. A graph G′ is τ-minimum τ-équivalent to G if it is τ-minimal
τ-équivalent to G and minimizes the number of arcs.
1. Draw the transitive closure of the following graphs :

B D B D
A
C E C

2. Add some arcs to G′ and G” such that G′ and G” are τ-minimal τ-equivalent to G and G”
contains strictly less arcs than G′ .

A A A

G G′ G”
B C B C B C

3. Show that G is strongly connected if and only if the circuit (x1 , x2 , . . . , xn ) is τ-equivalent to
G, where the xi s are the nodes of G.
4. Show that the previous property is false if we replace τ-equivalent by τ-minimal τ-equivalent.
5. Show that an elementary circuit is τ-minimum τ-equivalent to itself.
6. Show that a graph G is hamiltonian if and only if, every graph τ-minimum τ-equivalent to
G is an hamiltonian circuit of G.
Exercise 2 — τ equivalent graph of a acyclic digraph

Let G be a directed acyclic graph. Show that there exists a unique graph G′ that is τ-equivalent
to G and that minimize the number of arcs. Show that G′ is a partial graph of G.
Exercise 3 — τ-equivalent graphs and reduced graphs

Let G1 and G2 be the two following graphs :

G1 G2

b c d g b c d g

a j i f a j e f

k h e k h i

1
1. Compute the transitive closures of G1 and G2 .
2. Compute the reduced graphs G1R and G2R of G1 and G2 .
3. Compute the transitive closures of G1R and G2R .
4. Show that two graphs are τ-equivalent if and only if their reduced graphs are τ-equivalent.
Exercise 4 — Compute the transitive closure of a graph

1. Describe with pseudo code an algorithm computing the transitive closure of a graph using
the classical algorithms enumerating the nodes of a graph. What is its complexity ?
2. (a) Let A be the adjacency matrix of a graph G. What is Ap ?
(b) Let B be the adjacency matrix of a graph G with 1 on the diagonal cells. What is B p ?
(c) Describe in pseudocode an algorithm computing the transitive closure of a graph using
the powers of either the matrix A or the matrix B. What is its complexity ?
3. The Roy Wharshall algorithm is the following :

Require: A directed graph G = (U, A)


Ensure: The transitive closure of G
for w ∈ U do
for u ∈ U do
for v ∈ U do
if (u, w) ∈ A and (w, v) ∈ A then Add (u, v) to A.

(a) Run the algorithm on the following graph :

B
A D
C

(b) What is its complexity ?


(c) Describe the algorithm using only the adjacency matrix of G.
(d) Run the algorithm on the following matrix.
 
0 1 1 0
1 0 0 1
 
0 0 0 1
0 1 0 0
Exercise 5 — Equipment of a workshop

Nine machines, a, b . . ., h and i, are installed in a workshop. Mechanical parts are produced
by successive machines (drills, polishers, welds, . . .). We want to build conveyor belts at minimum
cost in order to move the pieces from a machine to another. The following array gives, for each
machine M , which machines may be used in a next step to build a product. We must link M to
each of those machines by a succession of belts. Model this problem with a graph problem and
solve it.
a b, c, d, e, f, g, h, i
b a, c, d, e, f, g, h, i
c d, e
d e
e d
f d, e, g, h, i
g d, e, f, h, i
h d, e, f, g, i
i d, e, f, g, h

You might also like