SlideShare a Scribd company logo
BREADTH FIRST SEARCH
(BFS)
PADA GRAPH
Algoritma dan Struktur
Data
Dr. Achmad Solichin,
S.Kom, M.T.I
GRAPH
V = {0, 1, 2, 3}
E = {(0,1), (0,2), (0,3), (1,2)}
G = {V, E}
Indirect Graph
GRAPH TERMINOLOGY
 Adjacency: A vertex is said to be adjacent to another vertex if
there is an edge connecting them. Vertices 2 and 3 are not
adjacent because there is no edge between them.
 Path: A sequence of edges that allows you to go from vertex A
to vertex B is called a path. 0-1, 1-2 and 0-2 are paths from
vertex 0 to vertex 2.
 Directed Graph: A graph in which an edge (u,v) doesn't
necessarily mean that there is an edge (v, u) as well. The
edges in such a graph are represented by arrows to show the
direction of the edge.
GRAPH REPRESENTATION
1. Adjacency Matrix 2. Adjacency List
BREADTH FIRST SEARCH (BFS)
ALGORITHM
The BFS algorithm works as follows:
1. Start by putting any one of the graph's vertices at the back of a
queue.
2. Take the front item of the queue and add it to the visited list.
3. Create a list of that vertex's adjacent nodes. Add the ones which
aren't in the visited list to the back of the queue.
4. Keep repeating steps 2 and 3 until the queue is empty.
STEP BY STEP BFS ALGORITHM – 1
We use an undirected graph with 5 vertices
STEP BY STEP BFS ALGORITHM – 2
We start from vertex 0, the BFS algorithm starts by
putting it in the Visited list and putting all its
adjacent vertices in the queue.
STEP BY STEP BFS ALGORITHM – 3
Next, we visit the element at the front of queue i.e. 1
and go to its adjacent nodes. Since 0 has already
been visited, we visit 2 instead.
STEP BY STEP BFS ALGORITHM – 4
Vertex 2 has an unvisited adjacent vertex in 4, so we
add that to the back of the queue and visit 3, which
is at the front of the queue.
STEP BY STEP BFS ALGORITHM – 5
Only 4 remains in the queue since the only adjacent
node of 3 i.e. 0 is already visited. We visit it.
Since the queue is empty, we have completed the Depth First Traversal of the graph
BFS PSEUDOCODE (RECURSIVE)
BFS IMPLEMENTATION IN
PROGRAMMING
C C++ Java
https://qrgo.page.link/x9Seghttps://qrgo.page.link/f5aH4https://qrgo.page.link/AZAnW
REFERENCES
 Slide “Graph: Pemahaman dan Konsep Dasar Graph – Algoritma dan
Struktur Data 3” by Moh. Sjukani (Universitas Budi Luhur)
 Slide “Graph Traversal (Penelusuran Graph) – Algoritma dan Struktur
Data 3” by Achmad Solichin (Universitas Budi Luhur)
 BFS Algorithm - https://www.programiz.com/dsa/graph-bfs
TERIMA KASIH
 Dr. Achmad Solichin, S.Kom., M.T.I.
 Fakultas Teknologi Informasi, Universitas Budi Luhur
 achmatim@gmail.com | Achmad.Solichin@budiluhur.ac.id
 http://achmatim.net
Ad

More Related Content

What's hot (20)

Infrastruktur Mode Jaringan Wireless
Infrastruktur Mode Jaringan WirelessInfrastruktur Mode Jaringan Wireless
Infrastruktur Mode Jaringan Wireless
TsaniaNB
 
Media Transmisi Guided Dan Unguided
Media Transmisi Guided Dan UnguidedMedia Transmisi Guided Dan Unguided
Media Transmisi Guided Dan Unguided
Erlangga Abdul Rahman
 
Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)
Adam Mukharil Bachtiar
 
Minggu 1 - Using Alice 3
Minggu 1 - Using Alice 3Minggu 1 - Using Alice 3
Minggu 1 - Using Alice 3
SMK Nurul Jadid
 
Edo A.G - Rangkaian Aritmatika
Edo A.G - Rangkaian AritmatikaEdo A.G - Rangkaian Aritmatika
Edo A.G - Rangkaian Aritmatika
Edo A.G
 
4. pengamanan sistem operasi
4. pengamanan sistem operasi4. pengamanan sistem operasi
4. pengamanan sistem operasi
Maghfir Muhammad Ramadhan
 
Pertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IFPertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IF
Achmad Solichin
 
Bahasa Indonesia
Bahasa IndonesiaBahasa Indonesia
Bahasa Indonesia
Afifah Sjahbandi
 
Pengenalan c++ bagian 3
Pengenalan c++ bagian 3Pengenalan c++ bagian 3
Pengenalan c++ bagian 3
Fazar Ikhwan Guntara
 
Tugas 1 analisis paket network protocol dengan menggunakan tools wireshark
Tugas 1 analisis paket network protocol dengan menggunakan tools wiresharkTugas 1 analisis paket network protocol dengan menggunakan tools wireshark
Tugas 1 analisis paket network protocol dengan menggunakan tools wireshark
Eka Putuasduki
 
Perulangan dan Array dalam PHP
Perulangan dan Array dalam PHPPerulangan dan Array dalam PHP
Perulangan dan Array dalam PHP
I Gede Iwan Sudipa
 
Mode Pengalamatan & Permasalahan Desain Pengalamatan
Mode Pengalamatan & Permasalahan Desain PengalamatanMode Pengalamatan & Permasalahan Desain Pengalamatan
Mode Pengalamatan & Permasalahan Desain Pengalamatan
lailalutfi
 
Proposal pembuatan aplikasi
Proposal pembuatan aplikasiProposal pembuatan aplikasi
Proposal pembuatan aplikasi
HIMATIF UIN SGD
 
Mp 4 mode-pengalamatan
Mp 4 mode-pengalamatanMp 4 mode-pengalamatan
Mp 4 mode-pengalamatan
Olbers Letfaar
 
Konsep pemrograman prosedur dalam pascal
Konsep pemrograman prosedur dalam pascalKonsep pemrograman prosedur dalam pascal
Konsep pemrograman prosedur dalam pascal
Simon Patabang
 
#1 PENGENALAN PYTHON
#1 PENGENALAN PYTHON#1 PENGENALAN PYTHON
#1 PENGENALAN PYTHON
Rachmat Wahid Saleh Insani
 
Rpl 010 - perancangan arsitektural
Rpl   010 - perancangan arsitekturalRpl   010 - perancangan arsitektural
Rpl 010 - perancangan arsitektural
Febriyani Syafri
 
Finite State Automata - Materi 3 - TBO
Finite State Automata - Materi 3 - TBOFinite State Automata - Materi 3 - TBO
Finite State Automata - Materi 3 - TBO
ahmad haidaroh
 
Kalimat efektif makalah
Kalimat efektif makalahKalimat efektif makalah
Kalimat efektif makalah
Mila Urmila
 
Infrastruktur Mode Jaringan Wireless
Infrastruktur Mode Jaringan WirelessInfrastruktur Mode Jaringan Wireless
Infrastruktur Mode Jaringan Wireless
TsaniaNB
 
Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)Data Management (Basis Data Berbasis Dokumen)
Data Management (Basis Data Berbasis Dokumen)
Adam Mukharil Bachtiar
 
Minggu 1 - Using Alice 3
Minggu 1 - Using Alice 3Minggu 1 - Using Alice 3
Minggu 1 - Using Alice 3
SMK Nurul Jadid
 
Edo A.G - Rangkaian Aritmatika
Edo A.G - Rangkaian AritmatikaEdo A.G - Rangkaian Aritmatika
Edo A.G - Rangkaian Aritmatika
Edo A.G
 
Pertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IFPertemuan 4 - Struktur Kondisi IF
Pertemuan 4 - Struktur Kondisi IF
Achmad Solichin
 
Tugas 1 analisis paket network protocol dengan menggunakan tools wireshark
Tugas 1 analisis paket network protocol dengan menggunakan tools wiresharkTugas 1 analisis paket network protocol dengan menggunakan tools wireshark
Tugas 1 analisis paket network protocol dengan menggunakan tools wireshark
Eka Putuasduki
 
Perulangan dan Array dalam PHP
Perulangan dan Array dalam PHPPerulangan dan Array dalam PHP
Perulangan dan Array dalam PHP
I Gede Iwan Sudipa
 
Mode Pengalamatan & Permasalahan Desain Pengalamatan
Mode Pengalamatan & Permasalahan Desain PengalamatanMode Pengalamatan & Permasalahan Desain Pengalamatan
Mode Pengalamatan & Permasalahan Desain Pengalamatan
lailalutfi
 
Proposal pembuatan aplikasi
Proposal pembuatan aplikasiProposal pembuatan aplikasi
Proposal pembuatan aplikasi
HIMATIF UIN SGD
 
Mp 4 mode-pengalamatan
Mp 4 mode-pengalamatanMp 4 mode-pengalamatan
Mp 4 mode-pengalamatan
Olbers Letfaar
 
Konsep pemrograman prosedur dalam pascal
Konsep pemrograman prosedur dalam pascalKonsep pemrograman prosedur dalam pascal
Konsep pemrograman prosedur dalam pascal
Simon Patabang
 
Rpl 010 - perancangan arsitektural
Rpl   010 - perancangan arsitekturalRpl   010 - perancangan arsitektural
Rpl 010 - perancangan arsitektural
Febriyani Syafri
 
Finite State Automata - Materi 3 - TBO
Finite State Automata - Materi 3 - TBOFinite State Automata - Materi 3 - TBO
Finite State Automata - Materi 3 - TBO
ahmad haidaroh
 
Kalimat efektif makalah
Kalimat efektif makalahKalimat efektif makalah
Kalimat efektif makalah
Mila Urmila
 

Similar to Breadth First Search (BFS) pada Graph (20)

Graph Theory
Graph TheoryGraph Theory
Graph Theory
Shivam Singh
 
Topological Sort and BFS
Topological Sort and BFSTopological Sort and BFS
Topological Sort and BFS
ArchanaMani2
 
bfs tree searching ,sortingUntitled presentation.pptx
bfs tree searching ,sortingUntitled presentation.pptxbfs tree searching ,sortingUntitled presentation.pptx
bfs tree searching ,sortingUntitled presentation.pptx
saurabhpandey679381
 
logic.pptx
logic.pptxlogic.pptx
logic.pptx
KENNEDY GITHAIGA
 
Daa chpater 12
Daa chpater 12Daa chpater 12
Daa chpater 12
B.Kirron Reddi
 
Representation of graph.pptx
Representation of graph.pptxRepresentation of graph.pptx
Representation of graph.pptx
DileepKumar386873
 
Unit V - ppt.pptx
Unit V - ppt.pptxUnit V - ppt.pptx
Unit V - ppt.pptx
Kongunadu College of Engineering and Technology
 
DATA STRUCTURES.pptx
DATA STRUCTURES.pptxDATA STRUCTURES.pptx
DATA STRUCTURES.pptx
KENNEDY GITHAIGA
 
Graphs
GraphsGraphs
Graphs
KomalPaliwal3
 
Graphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.ppt
Graphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.ppt
Graphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.ppt
babanazar7204
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
SwarndeviKm
 
Data Structures-Non Linear DataStructures-Graphs
Data Structures-Non Linear DataStructures-GraphsData Structures-Non Linear DataStructures-Graphs
Data Structures-Non Linear DataStructures-Graphs
sailaja156145
 
Graphs
GraphsGraphs
Graphs
amudha arul
 
Breadth-First-Search algorithm with Code
Breadth-First-Search algorithm with CodeBreadth-First-Search algorithm with Code
Breadth-First-Search algorithm with Code
Mustafa Sherazi
 
Data structure note
Data structure noteData structure note
Data structure note
Muhammad Nawaz
 
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptx
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptxUNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptx
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptx
kncetaruna
 
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdfClass01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
ChristianKapsales1
 
Graph data structures for ppt for understanding.pptx
Graph data structures for ppt for understanding.pptxGraph data structures for ppt for understanding.pptx
Graph data structures for ppt for understanding.pptx
ramkumar649780
 
Breadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptxBreadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptx
NicoleAngelaGilaRamo
 
Breadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptxBreadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptx
NicoleAngelaGilaRamo
 
Topological Sort and BFS
Topological Sort and BFSTopological Sort and BFS
Topological Sort and BFS
ArchanaMani2
 
bfs tree searching ,sortingUntitled presentation.pptx
bfs tree searching ,sortingUntitled presentation.pptxbfs tree searching ,sortingUntitled presentation.pptx
bfs tree searching ,sortingUntitled presentation.pptx
saurabhpandey679381
 
Representation of graph.pptx
Representation of graph.pptxRepresentation of graph.pptx
Representation of graph.pptx
DileepKumar386873
 
Graphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.ppt
Graphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.ppt
Graphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.pptGraphs.ppt
babanazar7204
 
Data Structures-Non Linear DataStructures-Graphs
Data Structures-Non Linear DataStructures-GraphsData Structures-Non Linear DataStructures-Graphs
Data Structures-Non Linear DataStructures-Graphs
sailaja156145
 
Breadth-First-Search algorithm with Code
Breadth-First-Search algorithm with CodeBreadth-First-Search algorithm with Code
Breadth-First-Search algorithm with Code
Mustafa Sherazi
 
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptx
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptxUNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptx
UNIT IV NON LINEAR DATA STRUCTURES - GRAPH.pptx
kncetaruna
 
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdfClass01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
Class01_Computer_Contest_Level_3_Notes_Sep_07 - Copy.pdf
ChristianKapsales1
 
Graph data structures for ppt for understanding.pptx
Graph data structures for ppt for understanding.pptxGraph data structures for ppt for understanding.pptx
Graph data structures for ppt for understanding.pptx
ramkumar649780
 
Breadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptxBreadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptx
NicoleAngelaGilaRamo
 
Breadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptxBreadth First Searching Algorithm (BFS).pptx
Breadth First Searching Algorithm (BFS).pptx
NicoleAngelaGilaRamo
 
Ad

More from Achmad Solichin (20)

Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Achmad Solichin
 
Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)
Achmad Solichin
 
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Achmad Solichin
 
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Achmad Solichin
 
Webinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHPWebinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHP
Achmad Solichin
 
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi LuhurWebinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Achmad Solichin
 
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARUTREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Materi Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHPMateri Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHP
Achmad Solichin
 
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan RadiasiPercobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Binary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur DataBinary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur Data
Achmad Solichin
 
Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0
Achmad Solichin
 
Seminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web ProgrammerSeminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web Programmer
Achmad Solichin
 
The Big 5: Future IT Trends
The Big 5: Future IT TrendsThe Big 5: Future IT Trends
The Big 5: Future IT Trends
Achmad Solichin
 
Modern PHP Developer
Modern PHP DeveloperModern PHP Developer
Modern PHP Developer
Achmad Solichin
 
Seminar: PHP Developer for Dummies
Seminar: PHP Developer for DummiesSeminar: PHP Developer for Dummies
Seminar: PHP Developer for Dummies
Achmad Solichin
 
Pertemuan 1 - Algoritma dan Struktur Data 1
Pertemuan 1 - Algoritma dan Struktur Data 1Pertemuan 1 - Algoritma dan Struktur Data 1
Pertemuan 1 - Algoritma dan Struktur Data 1
Achmad Solichin
 
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Achmad Solichin
 
Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?
Achmad Solichin
 
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Kuliah Umum - Tips Publikasi Jurnal SINTA untuk Mahasiswa Galau (6 Agustus 2022)
Achmad Solichin
 
Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)Materi Webinar Web 3.0 (16 Juli 2022)
Materi Webinar Web 3.0 (16 Juli 2022)
Achmad Solichin
 
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Webinar: Kesadaran Keamanan Informasi (3 Desember 2021)
Achmad Solichin
 
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Webinar PHP-ID: Mari Mengenal Logika Fuzzy (Fuzzy Logic)
Achmad Solichin
 
Webinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHPWebinar PHP-ID: Machine Learning dengan PHP
Webinar PHP-ID: Machine Learning dengan PHP
Achmad Solichin
 
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi LuhurWebinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Webinar Data Mining dengan Rapidminer | Universitas Budi Luhur
Achmad Solichin
 
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARUTREN DAN IDE RISET BIDANG DATA MINING TERBARU
TREN DAN IDE RISET BIDANG DATA MINING TERBARU
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Materi Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHPMateri Seminar: Artificial Intelligence dengan PHP
Materi Seminar: Artificial Intelligence dengan PHP
Achmad Solichin
 
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan RadiasiPercobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Percobaan Perpindahan Kalor melalui Konduksi, Konveksi dan Radiasi
Achmad Solichin
 
Metodologi Riset: Literature Review
Metodologi Riset: Literature ReviewMetodologi Riset: Literature Review
Metodologi Riset: Literature Review
Achmad Solichin
 
Binary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur DataBinary Search Tree (BST) - Algoritma dan Struktur Data
Binary Search Tree (BST) - Algoritma dan Struktur Data
Achmad Solichin
 
Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0Computer Vision di Era Industri 4.0
Computer Vision di Era Industri 4.0
Achmad Solichin
 
Seminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web ProgrammerSeminar: Become a Reliable Web Programmer
Seminar: Become a Reliable Web Programmer
Achmad Solichin
 
The Big 5: Future IT Trends
The Big 5: Future IT TrendsThe Big 5: Future IT Trends
The Big 5: Future IT Trends
Achmad Solichin
 
Seminar: PHP Developer for Dummies
Seminar: PHP Developer for DummiesSeminar: PHP Developer for Dummies
Seminar: PHP Developer for Dummies
Achmad Solichin
 
Pertemuan 1 - Algoritma dan Struktur Data 1
Pertemuan 1 - Algoritma dan Struktur Data 1Pertemuan 1 - Algoritma dan Struktur Data 1
Pertemuan 1 - Algoritma dan Struktur Data 1
Achmad Solichin
 
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Sharing Penelitian S3 Lab Elins FMIPA UGM - 17 Februari 2016
Achmad Solichin
 
Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?Seminar: Mau jadi Android User atau Developer?
Seminar: Mau jadi Android User atau Developer?
Achmad Solichin
 
Ad

Recently uploaded (20)

Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Unit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdfUnit 6_Introduction_Phishing_Password Cracking.pdf
Unit 6_Introduction_Phishing_Password Cracking.pdf
KanchanPatil34
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 

Breadth First Search (BFS) pada Graph

  • 1. BREADTH FIRST SEARCH (BFS) PADA GRAPH Algoritma dan Struktur Data Dr. Achmad Solichin, S.Kom, M.T.I
  • 2. GRAPH V = {0, 1, 2, 3} E = {(0,1), (0,2), (0,3), (1,2)} G = {V, E} Indirect Graph
  • 3. GRAPH TERMINOLOGY  Adjacency: A vertex is said to be adjacent to another vertex if there is an edge connecting them. Vertices 2 and 3 are not adjacent because there is no edge between them.  Path: A sequence of edges that allows you to go from vertex A to vertex B is called a path. 0-1, 1-2 and 0-2 are paths from vertex 0 to vertex 2.  Directed Graph: A graph in which an edge (u,v) doesn't necessarily mean that there is an edge (v, u) as well. The edges in such a graph are represented by arrows to show the direction of the edge.
  • 4. GRAPH REPRESENTATION 1. Adjacency Matrix 2. Adjacency List
  • 5. BREADTH FIRST SEARCH (BFS) ALGORITHM The BFS algorithm works as follows: 1. Start by putting any one of the graph's vertices at the back of a queue. 2. Take the front item of the queue and add it to the visited list. 3. Create a list of that vertex's adjacent nodes. Add the ones which aren't in the visited list to the back of the queue. 4. Keep repeating steps 2 and 3 until the queue is empty.
  • 6. STEP BY STEP BFS ALGORITHM – 1 We use an undirected graph with 5 vertices
  • 7. STEP BY STEP BFS ALGORITHM – 2 We start from vertex 0, the BFS algorithm starts by putting it in the Visited list and putting all its adjacent vertices in the queue.
  • 8. STEP BY STEP BFS ALGORITHM – 3 Next, we visit the element at the front of queue i.e. 1 and go to its adjacent nodes. Since 0 has already been visited, we visit 2 instead.
  • 9. STEP BY STEP BFS ALGORITHM – 4 Vertex 2 has an unvisited adjacent vertex in 4, so we add that to the back of the queue and visit 3, which is at the front of the queue.
  • 10. STEP BY STEP BFS ALGORITHM – 5 Only 4 remains in the queue since the only adjacent node of 3 i.e. 0 is already visited. We visit it. Since the queue is empty, we have completed the Depth First Traversal of the graph
  • 12. BFS IMPLEMENTATION IN PROGRAMMING C C++ Java https://qrgo.page.link/x9Seghttps://qrgo.page.link/f5aH4https://qrgo.page.link/AZAnW
  • 13. REFERENCES  Slide “Graph: Pemahaman dan Konsep Dasar Graph – Algoritma dan Struktur Data 3” by Moh. Sjukani (Universitas Budi Luhur)  Slide “Graph Traversal (Penelusuran Graph) – Algoritma dan Struktur Data 3” by Achmad Solichin (Universitas Budi Luhur)  BFS Algorithm - https://www.programiz.com/dsa/graph-bfs
  • 14. TERIMA KASIH  Dr. Achmad Solichin, S.Kom., M.T.I.  Fakultas Teknologi Informasi, Universitas Budi Luhur  [email protected] | [email protected]  http://achmatim.net