1 / 17

Licence d’informatique Algorithmique des graphes

Licence d’informatique Algorithmique des graphes. Cours 3 deuxième partie : Opérations et relations entre graphes. Composition, puissances. Utilisation de ce document strictement réservée aux étudiants de l ’IFSIC dans le cadre de leur formation.

sara-craig
Download Presentation

Licence d’informatique Algorithmique des graphes

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Licence d’informatiqueAlgorithmique des graphes Cours 3 deuxième partie : Opérations et relations entre graphes. Composition, puissances. Utilisation de ce document strictement réservée aux étudiants de l ’IFSIC dans le cadre de leur formation. Reproduction ou diffusion en dehors de l ’IFSIC strictement interdite sauf autorisation expresse de l’ auteur.

  2. 7 4 1 1 7 4 6 6 9 2 3 8 5 9 2 3 8 5 G1 G2 Opérations entre graphes G(X) = ensemble des graphes construits sur l’ensemble de sommets X

  3. 7 1 4 1 7 4 6 6 9 9 2 2 3 3 8 8 5 5 G2 G1 Relation d’ordre : graphe partiel G1  G2  1  2

  4. 7 4 1 1 7 4 6 6 2 2 3 3 9 9 8 8 5 5 Relation d’ordre : graphe partiel Elément MINIMAL : (X,) Elément MAXIMAL : (X, X2)

  5. 7 1 7 7 1 4 4 7 1 1 4 4 6 6 6 6 9 9 2 2 9 9 2 2 3 3 3 3 8 8 8 8 5 5 5 5 G1 G2 Union G1  G2 = (X, 1  2) G1 G2

  6. 1 4 1 4 4 1 Composition G1 G2 = ( X, 12 ) 9 2 9 2 3 8 3 G1 8 9 2 3 G1 G2 8 G2

  7. $ z : 1 £ z £ n : G1.validarc(x,z) et G2.validarc(z,y) Formellement, on a donc : (x, y)1  2 

  8. 1 k k+1 n 1 £ k £ n et b= $ z : 1 £ z £ k : P(z) k = n ARRET b OU 1 z k k+1 n si balors « succès  »  sinon {non b et k=n }« échec » 1 k=n EVALUATION DE $ z : 1 £ z £ n : G1.validarc(x,z) et G2.validarc(z,y) $ z : 1 £ z £ n : P(z) INVARIANT

  9. 1 k k+1 n 1 £ k £ n et b= $ z : 1 £ z £ k : P(z) b ou k = n si balors « succès  »  sinon {non b et k=n }« échec » PROGRESSION 1 k k+1 n k k+1 {non b et k<n} EVALUATION DE $ z : 1 £ z £ n : G1.validarc(x,z) et G2.validarc(z,y) $ z : 1 £ z £ n : P(z) INVARIANT ARRET

  10. 1 k k+1 n 1 £ k £ n et b= $ z : 1 £ z £ k : P(z) b ou k = n si balors « succès  »  sinon {non b et k=n }« échec » ? k := k+1 ; b := P(k) PROGRESSION 1 k k+1 n k k+1 {non b et k<n} EVALUATION DE $ z : 1 £ z £ n : G1.validarc(x,z) et G2.validarc(z,y) $ z : 1 £ z £ n : P(z) INVARIANT ARRET

  11. 1 k k+1 n 1 £ k £ n et b= $ z : 1 £ z £ k : P(z) b ou k = n si balors « succès  »  sinon {non b et k=n }« échec » k := k+1 ; b := P(k) INIT k := 1 ; b := P(1) EVALUATION DE $ z : 1 £ z £ n : G1.validarc(x,z) et G2.validarc(z,y) $ z : 1 £ z £ n : P(z) INVARIANT ARRET PROGRESSION {non b et k<n} k=0 1 n

  12. GRAPHE composer (GRAPHE G1, G2) pré égal (G1.lst_som , G2.lst_som) local SOMMETx, y, k ; BOOLEANb debut Result.inivide ; pourtout x de G1.lst_som pourtout y de G2.lst_som depuis k := 1 ; b := G1.validarc(x, 1) et G2.validarc(1, y) jusqu’à b ou k = G1.nb_som faire k := k+1 ; b := G1.validarc(x, k) et G2.validarc(k, y) fait ; si b alors Result.ajoutarc(x,y) fsi fpourtout fpourtout fin

  13. COMPLEXITE pourtout x de G1.sommets ---------------------------------------------> n étapespourtout y de G1.sommets --------------------------------> n étapes depuis k := 0 ; b := faux jusqu’à b ou k = G1.nb_sommets ---------> au pire n étapes faire k := k+1 ; b := G1.valid_arc(x, k) et G2.valid_arc(k, y) 2 accès  n3 fait ; si b alors Result.ajout_arc(x,y) fsi 1 accès  n2 Soit un algorithme en O(n3)

  14. 2F 3H 2F 3H 2F 2H 2F 2H 3F 3F 1F 1H 1F 1H 1F 1F 3F 3H 0 0 1F 3H 1F 3H 3H 3H 2F 2F Gv Gr o 3F 3H Gv Gr

  15. 2F 3H 2F 3H 2F 2H 2F 2H 3F 3F 1F 1H 1F 1H 1F 1F 0 0 1F 3H 1F 3H 3H 3H 2F 2F Graphe partiel de Gvaboutissant à 0 3F 3H Union 3F 3H

  16. Puissances d’un graphe G[1] = G p  2 : G[p] = G [p-1]G Interprétation concrète : p  1 : (x, y)  [p] Il existe un chemin de longueur p allant de x à y

  17. Démonstration : Par récurrence sur p x z y p 1 p+1 • Cas de base :p = 1 (x, y) [1] Il existe un chemin de longueur 1 allant de x à y Vrai, puisque [1] =  et les chemins de longueur 1 sont les arcs • Induction :vrai pourpvrai pour p+1 (x, y) [p+1] (x, y) [p]  Il existe z, (x, z) [p]et (z, y)  (Définition de )  Il existe z, il existe un chemin delongueur p allant de x à z et un arc (z, y) (Hypothèse de récurrence)  Il existe un chemin de longueur p+1 allant de x à y

More Related