1 / 11

Gráf szélességi bejárása

Algoritmusok II. Gyakorlat 2. Feladat Pup Márton. Gráf szélességi bejárása. G: irányított, véges, nem üres gráf Q: sor adatszerkezet H: halmaz (már elért csúcsok) d[1..10]: csúcsok távolsága s-től  [1..10]: szülők. Alap információk:. Fehér : még nem értük el

nathan
Télécharger la présentation

Gráf szélességi bejárása

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. Algoritmusok II. Gyakorlat 2. Feladat Pup Márton Gráf szélességi bejárása

  2. G: irányított, véges, nem üres gráf • Q: sor adatszerkezet • H: halmaz (már elért csúcsok) • d[1..10]: csúcsok távolsága s-től • [1..10]: szülők Alap információk:

  3. Fehér: még nem értük el • Szürke: elértük, de a nincs kiírva • Fekete: kiírtuk és kiterjesztettük Csúcsok státusza:

  4. Kezdeti állapot: A C D G F E H B H= Q= d[1..8]= [1..8]=NIL G: s=

  5. 1. lépés B H F G E C A D H=A Q=A d: : G: s= 0 nil nil  nil   nil nil  nil  nil  nil 

  6. 2. lépés B H F G E C A D H=ABCD Q=BCD d: : G: s= 0 nil 1 1 1 1 1 1 nil  nil  nil  nil 

  7. 3. lépés B H F G E C A D H=ABCDEF Q=CDEF d: : G: s= 0 nil 1 1 1 1 1 1 2 2 2 2 nil  nil 

  8. 4. lépés B H F G E C A D H=ABCDEF Q=DEF d: : G: s= 0 nil 1 1 1 1 1 1 2 2 2 2 nil  nil 

  9. 5. lépés B H F G E C A D H=ABCDEFG Q=EFG d: : G: s= 0 nil 1 1 1 1 1 1 2 2 2 2 4 2 nil 

  10. 6. lépés B H F G E C A D H=ABCDEFGH Q=FGH d: : G: s= 0 nil 1 1 1 1 1 1 2 2 2 2 4 2 5 3

  11. Vége…

More Related