1 / 27

Graph

Graph. Struktur Data. Graph. Dinotasikan sebagai G=(V,E) V=himpunan vertex E=himpunan edge Pada contoh V= {1,2,3,4,5,6} E= {(1,2),(1,4),(2,5),(3,5), (3,6),(4,2),(5,4),(6,6)}. Pemanfaatan Graph.

Download Presentation

Graph

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. Graph Struktur Data

  2. Graph Dinotasikan sebagai G=(V,E) • V=himpunan vertex • E=himpunan edge Pada contoh • V= {1,2,3,4,5,6} • E= {(1,2),(1,4),(2,5),(3,5), (3,6),(4,2),(5,4),(6,6)}

  3. Pemanfaatan Graph • Representasi lokasi terhadap jalan-jalan yang menghubungkan. Contoh pemodelan jalur bus pada mother board • Representasi urutan state (dari rangkaian state): contoh dependency graph

  4. Type Graph • Berdasarkan ada tidaknya arah pada edge graph dikategorikan sebagai directed (gambar kiri) ataupun undirected graph (gambar kanan)

  5. Representasi • Representasi graph yang umum digunakan adalah • adjacency list (cocok untuk sparse graph) • adjancecy matrix

  6. Contoh representasi

  7. Teknik Penelusuran Graph • Teknik penelusuran: BFS dan DFS • Breadth First Search (BFS), penelusuran melebar • Depth First Search (DFS), penelusuran mendalam

  8. Algoritma BFS

  9. Ilustrasi BFS

  10. Algoritma DFS

  11. Ilustrasi DFS

  12. Contoh Pemanfaataan DFS • Topologycal Sort (TS)

  13. Ilustrasi TS

  14. Minimum Spanning Tree • Spanning tree dari sebuah graph adalah seluruh kemungkinan tree yang dapat di bentuk pada graph • Minimum spanning Tree (MST), spanning tree dengan total bobot edge terkecil • Pemanfaatan: pemilihan jalan yang ingin di aspal, namun dana minim 

  15. Algoritma MST • Ada dua algoritma MST yang umum digunakan • Prim • kruskal

  16. Algoritma PRIM

  17. Ilustrasi PRIM (i)

  18. Ilustrasi PRIM (ii)

  19. Algoritma Kruskal

  20. Ilustrasi Kruskal (i)

  21. Ilustrasi Kruskal (ii)

  22. Ilustrasi Kruskal (iii)

  23. Dijkstra Shortest Path • Penentuan rute terpendek antara dua verteks pada graph • Mode • Single source Single Destination • Single source multi destination • Multi source single destination

  24. Algoritma Dijkstra

  25. Relax algorithm (on Dijkstra)

  26. Ilustrasi Dijkstra

  27. sekian

More Related