• Aucun résultat trouvé

DESCHINKEL Karine november 2013

N/A
N/A
Protected

Academic year: 2022

Partager "DESCHINKEL Karine november 2013"

Copied!
4
0
0

Texte intégral

(1)

DESCHINKEL Karine november 2013 Exam on Graphs (CP58) - 1H30 -

Exercise 1 (/10)

1)Write the adjacency matrix and the incidence matrix of the following directed acyclic graph 2) Give the degree of each vertex

3) Show the (DFS) depth-first spanning tree (highlight tree edges, back edges, forward edges, cross edges with different colors). Start at vertex 1 for your DFS , and when there is a choice of which edge to follow, always choose the one to the vertex that is first numerically.

4) Apply an algorithm (which one?) to detect if there is cycle in the graph. Show the different steps of the algorithm on this example (starting from vertex 1).

5) Is there articulation point(s) in the graph ? If yes, quote it (them).

6) Imagine that this graph is a contact graph for assembly of a particular device. First change the direction of the edge (3,9). Apply an algorithm (which one?) to remove redundant constraints of precedence. Write down the simplified graph and the first step of the algorithm.

7) Give a valid assembly sequence for this contact graph.

Exercise 2 (/4)

1) Give the definition of a strongly connected component in a directed graph?

2) Suppose G=(V,E) is a directed graph. Here is an algorithm to detect strongly connected Components in a directed graph

Step 1 : Call a DFS1 (Depth First Search) for the graph G and compute the postorder PO DFS1(G)

{

PO(x) <- 0 for all x in V

counter ← 0

WHILE there exists a vertex s such that PO(s)=0 choose one vertex s, mark s

FOR each unmarked successor w of s DFSRec1(w,counter)

ENDFOR

counter ++

PO(s) ← counter

ENDWHILE

}

9 1

4

3 6

8 5

2

7

(2)

DESCHINKEL Karine november 2013

DFSRec1(x,counter) {

mark x

FOR each unmarked successor y of x DFSRec1(y,counter)

ENDFOR

counter ++

PO(x) ← counter

}

Step 2 : Consider the reverse graph GT . The reverse graph GT of a directed graph G is another directed graph on the same set of vertices with all of the edges reversed compared to the orientation of the corresponding edges in G. That is, if G contains an edge (u,v) then the reverse of G contains an edge (v,u) and vice versa.

Step 3 : Call a DFS for the graph GT, starting from vertex v with the maximal postorder, DFS2(GT)

{

SCC(x) <- 0 for all x in V

counter ← 0

WHILE there exists a vertex s such that SCC(s)=0 choose one vertex s with maximal PO, mark s counter ++

SCC(s) ← counter

FOR each unmarked successor w of s DFSRec2(w,counter)

ENDFOR

ENDWHILE

}

DFSRec2(x,counter) {

mark x

SCC(x) ← counter

FOR each unmarked successor y of x DFSRec2(y,counter)

ENDFOR

}

Try to apply this algorithm on this graph. Quote the different strongly connected components of the graph. SCC gives the number of strongly connected component which the vertex x belongs.

1

4

3 6

8 5

2

7

9

(3)

DESCHINKEL Karine november 2013

Exercise 3 (/4)

One step in the procedure for generating assembly sequences in the software ORASSE consists in identifying some sub-assemblies by searching for specific patterns in the graph. A pattern is a subgraph of the simplified contact graph of the product and contains at minimum 2 vertices of the same color (2 components assigned to the same technical function). Figure 1 shows two different patterns in the contact graph. One indicator of modularity is based on the minimal distance d between any pair of colored vertices in sub-assemblies.

Let define M=(VM, EM) a coloured pattern.

VC is the set of colored vertices in the pattern M.

λu= min { distance(u,v), v in VC}, Δ=min {λu, u in VC} .

Here, the distance between two vertices in a graph is the minimal number of edges in a shortest path connecting them (regardless of the direction of the arrows).

1. Propose an algorithm based on a known algorithm which allows to compute Δ for a particular pattern M.

2. Apply your method on the pattern on figure 2. Detail main steps of your method.

figure 1 : a pattern M with 5 components M=(VM, EM) a coloured pattern.

VM = {a,b,c,d,e}

EM = {(a,d), (a,c), (c,b), (b,e), (d,e)}

VC is the set of colored vertices in the pattern M.

VC = {c,d,e}

λu= min { distance(u,v), v in VC} :

λc= min {distance (c,d) = 2, distance (c,e)=2}=2 λd= min {distance (d,c) = 2, distance (d,e)=1}=1 λe= min {distance (e,c) = 2, distance (e,d)=1}=1 Δ=min {λu, u in VC} :

Δ=min {λc , λd, λe }=1 a

d

c

e

b

(4)

DESCHINKEL Karine november 2013

figure 2 : a pattern M with 6 components, VC = {a,f,c}

Exercise 4 (/2)

Imagine an algorithm based on the classification of edges during the execution of a DFS to simplify a contact graph (eliminate redundant constraints). Apply your algorithm on this contact graph and give some explanation. Write down the resulting graph.

1

4

3 6

8 5

2

7

9 a

d c

e b

f

Références

Documents relatifs

The main idea of the proof is to recursively decompose the tree into subtrees, and study the process restricted to each one. The decomposition approach has already been used in

Mais les liens entre la formation et les besoins de l’industrie peuvent encore se renforcer par le dialogue et les échanges, par exemple au travers de forums où les industriels

In order to obtain a dense depth map, the expression of the ratio between the gradient magnitude of the sharp image and the gradient magnitude of the blur image has to be defined

showed that a spanning tree in a 3 − connected cubic graph avoids at least two removable edges, and Kang, Li and Wu [4] showed that a spanning tree contains at least two

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des

Therefore we consider the situation where the stress free strain E is constant, non zero, in a half space bounded by a wedge, whose edge is along Oxl. We shall name

Then we will discuss a generalization of matchstick graphs being proposed in [5] where more than one matchstick in a straight line can be used for an edge, that is, we ask for