Mata kuliah :K0362/ Matematika Diskrit Tahun :2008

Slides:



Advertisements
Presentasi serupa
Struktur Data Departemen Ilmu Komputer FMIPA-IPB 2009
Advertisements

TEKNIK PENCARIAN (SEARCHING)
Binary Tree Traversal.
Algoritma dan Struktur Data
Pertemuan Struktur Data *Pohon Ekspresi *
PART 4 TREE (POHON) Dosen : Ahmad Apandi, ST
Game Theory Purdianta, ST., MT..
ADT Tree 2007/2008 – Ganjil – Minggu 8.
K-Map Using different rules and properties in Boolean algebra can simplify Boolean equations May involve many of rules / properties during simplification.
Roesfiansjah Rasjidin Program Studi Teknik Industri Fakultas Teknik – Univ. Esa Unggul.
Algoritma dan Struktur Data
1 DATA STRUCTURE “ STACK” SHINTA P STMIK MDP APRIL 2011.
Sistem Operasi 7 “Deadlock”.
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
Algoritma dan Struktur Data
Pertemuan 23 Minimum Cost Spanning Tree
1 Diselesaikan Oleh KOMPUTER Langkah-langkah harus tersusun secara LOGIS dan Efisien agar dapat menyelesaikan tugas dengan benar dan efisien. ALGORITMA.
Pertemuan 13 Graph + Tree jual [Valdo] Lunatik Chubby Stylus.
Algoritma dan Struktur Data
1 Pertemuan 09 Kebutuhan Sistem Matakuliah: T0234 / Sistem Informasi Geografis Tahun: 2005 Versi: 01/revisi 1.
Pewarnaan graph Pertemuan 20: (Off Class)
Masalah Transportasi II (Transportation Problem II)
1 Pertemuan 10 Fungsi Kepekatan Khusus Matakuliah: I0134 – Metode Statistika Tahun: 2007.
BAB 6 KOMBINATORIAL DAN PELUANG DISKRIT. KOMBINATORIAL (COMBINATORIC) : ADALAH CABANG MATEMATIKA YANG MEMPELAJARI PENGATURAN OBJEK- OBJEK. ADALAH CABANG.
Pertemuan 21 BASIC SEARCH AND TRAVERSAL
PERTEMUAN KE-6 UNIFIED MODELLING LANGUAGE (UML) (Part 2)
1 Pertemuan 17 Heaps Matakuliah: T0026/Struktur Data Tahun: 2005 Versi: 1/1.
Bina Nusantara Mata Kuliah: K0194-Pemodelan Matematika Terapan Tahun : 2008 Aplikasi Model Markov Pertemuan 22:
HAMPIRAN NUMERIK SOLUSI PERSAMAAN NIRLANJAR Pertemuan 3
1 Pertemuan 8 JARINGAN COMPETITIVE Matakuliah: H0434/Jaringan Syaraf Tiruan Tahun: 2005 Versi: 1.
1 Pertemuan 15 Game Playing Matakuliah: T0264/Intelijensia Semu Tahun: Juli 2006 Versi: 2/1.
1 Minggu 10, Pertemuan 20 Normalization (cont.) Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
1 Pertemuan 13 Algoritma Pergantian Page Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5.
1 Pertemuan 6 Komunikasi antar Proses (IPC) Lanjutan Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS01.
Pertemuan 9 : Pewarnaan graph
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
Binary Search Tree. Sebuah node di Binary Search Tree memiliki path yang unik dari root menurut aturan ordering – Sebuah Node, mempunyai subtree kiri.
Binary Tree.
POHON / TREE.
Defri Kurniawan POHON DAN POHON BINER Defri Kurniawan
STATISTIKA CHATPER 4 (Perhitungan Dispersi (Sebaran))
HTML BASIC (Contd…..) PERTEMUAN KEDUA.
KOMUNIKASI DATA Materi Pertemuan 3.
MATRIKS PENYAJIAN GRAPH
Dynamic Array and Linked List
Design and Analysis Algorithm
Diagram Pohon (Tree Diagram)
Pertemuan 22 Graph Operation
Mata kuliah :K0144/ Matematika Diskrit Tahun :2008
Dasar-Dasar Pemrograman
Parabola Parabola.
STRUKTUR DATA 2014 M. Bayu Wibisono.
Materi 11 Teori Graf.
Tim Struktur Data Program Studi Teknik Informatika UNIKOM
Algorithms and Programming Searching
REAL NUMBERS EKSPONENT NUMBERS.
Tim Struktur Data Program Studi Teknik Informatika UNIKOM
Mata kuliah :K0362/ Matematika Diskrit Tahun :2008
Parts of a Tree.
Data Structure Graph Representation © Sekolah Tinggi Teknik Surabaya.
Penelusuran Binary Tree
Tim Struktur Data Program Studi Teknik Informatika UNIKOM
Tree (Pohon).
POHON Pohon (Tree) merupakan graph terhubung tidak berarah dan tidak mengandung circuit. Contoh: (Bukan) (Bukan) (Bukan)
Fungsi Kepekatan Peluang Khusus Pertemuan 10
Pertemuan #1 The Sentence
Master data Management
Algoritma dan Struktur Data
Aplikasi Graph Minimum Spaning Tree Shortest Path.
Review Struktur Data Nisa’ul Hafidhoh, MT.
Transcript presentasi:

Mata kuliah :K0362/ Matematika Diskrit Tahun :2008 Tree Graph Pertemuan 10 :

Learning Outcomes Mahasiswa dapat menunjukkan tree yg meliputi konsep dasar tree, komponen tree, jenis-jenisnya dan contoh tentang penyelesain masalah dgn menggunakan tree atau ordered rooted tree. Mahasiswa dapat mengkombinasikan materi Ordered Rooted Tree dgn disiplin ilmu yg lain serta menerapkannya untuk berbagai kasus..

Outline Materi: Pengertian Tree Spanning Tree Cabang, akar & daun Titik berat, Berat pohon & Pusat berat Ordered Rooted Tree Pengertian Ordered rooted tree Leksikografik order Prefix form/ Pre order Posfix form/Post order Infix form/ In order Contoh pemakaian

Pengertian Pohon Suatu graph yang banyak vertexnya sama dengan n (n>1) disebut pohon, jika : Graph tersebut tidak mempunyai lingkar (cycle free) dan banyaknya rusuk (n-1). Graph tersebut terhubung .

Pengertian Pohon (2) Diagram pohon, diagram pohon merupakan digraph, yang : mempunyai source tak ada vertex yang indegreenya lebih dari satu. hutan (forest) = himpunan pohon diagram pohon dapat digunakan sebagai alat untuk memecahkan masalah dengan menggambarkan semua alternatif pemecahan. Hutan : banyaknya titik = n banyaknya pohon = k banyaknya rusuk = n-k

Applications of Graphs: Topological Sorting Topological order A list of vertices in a directed graph without cycles such that vertex x precedes vertex y if there is a directed edge from x to y in the graph There may be several topological orders in a given graph Topological sorting Arranging the vertices into a topological order

Topological Sorting Figure 13.14 Figure 13.15 A directed graph without cycles Figure 13.15 The graph in Figure 13-14 arranged according to the topological orders a) a, g, d, b, e, c, f and b) a, b, g, d, e, f, c

Topological Sorting Simple algorithms for finding a topological order topSort1 (Example: Figure 13-16) Find a vertex that has no successor Remove from the graph that vertex and all edges that lead to it, and add the vertex to the beginning of a list of vertices Add each subsequent vertex that has no successor to the beginning of the list When the graph is empty, the list of vertices will be in topological order

Topological Sorting Simple algorithms for finding a topological order (Continued) topSort2 (Example: Figure 13-17) A modification of the iterative DFS algorithm Strategy Push all vertices that have no predecessor onto a stack Each time you pop a vertex from the stack, add it to the beginning of a list of vertices When the traversal ends, the list of vertices will be in topological order

Spanning Trees A tree An undirected connected graph without cycles A spanning tree of a connected undirected graph G A subgraph of G that contains all of G’s vertices and enough of its edges to form a tree Example: Figure 13-18 To obtain a spanning tree from a connected undirected graph with cycles Remove edges until there are no cycles

Spanning Trees You can determine whether a connected graph contains a cycle by counting its vertices and edges A connected undirected graph that has n vertices must have at least n – 1 edges A connected undirected graph that has n vertices and exactly n – 1 edges cannot contain a cycle A connected undirected graph that has n vertices and more than n – 1 edges must contain at least one cycle

Spanning Trees Figure 13.19 Connected graphs that each have four vertices and three edges

The DFS Spanning Tree To create a depth-first search (DFS) spanning tree Traverse the graph using a depth-first search and mark the edges that you follow After the traversal is complete, the graph’s vertices and marked edges form the spanning tree Example: Figure 13-20

The BFS Spanning Tree To create a breath-first search (BFS) spanning tree Traverse the graph using a breadth-first search and mark the edges that you follow When the traversal is complete, the graph’s vertices and marked edges form the spanning tree Example: Figure 13-21

Minimum Spanning Tree Minimum spanning tree A spanning tree for which the sum of its edge weights is minimal Prim’s algorithm Finds a minimal spanning tree that begins at any vertex Strategy (Example: Figures 13-22 and 13-23) Find the least-cost edge (v, u) from a visited vertex v to some unvisited vertex u Mark u as visited Add the vertex u and the edge (v, u) to the minimum spanning tree Repeat the above steps until there are no more unvisited vertices

Tree Traversals Definition: A traversal is the process for “visiting” all of the vertices in a tree Often defined recursively Each kind corresponds to an iterator type Iterators are implemented non-recursively

Visit vertex, then visit child vertices (recursive definition) Preorder Traversal Visit vertex, then visit child vertices (recursive definition) Depth-first search Begin at root Visit vertex on arrival Implementation may be recursive, stack-based, or nested loop

Preorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4 5

Preorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4 5

Postorder Traversal Visit child vertices, then visit vertex (recursive definition) Depth-first search Begin at root Visit vertex on departure Implementation may be recursive, stack-based, or nested loop

Postorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4

Postorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4

Postorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4

Postorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4

Levelorder Traversal Visit all vertices in level, starting with level 0 and increasing Breadth-first search Begin at root Visit vertex on departure Only practical implementation is queue-based

Levelorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4

Levelorder Traversal 1 2 3 4 5 6 8 7 root 1 2 3 4 5 6 8 7 root 1 2 3 4

Tree Traversals Preoder: depth-first search (possibly stack-based), visit on arrival Postorder: depth-first search (possibly stack-based), visit on departure Levelorder: breadth-first search (queue-based), visit on departure

Binary Trees Definition: A binary tree is a rooted tree in which no vertex has more than two children Definition: A binary tree is complete iff every layer but the bottom is fully populated with vertices. root 1 2 3 4 5 6 7

Binary Tree Traversals Inorder traversal Definition: left child, visit, right child (recursive) Algorithm: depth-first search (visit between children)

Inorder Traversal 1 2 3 4 5 7 6 root 1 2 3 4 5 7 6 root 1 2 3 4 5 7 6

Inorder Traversal 1 2 3 4 5 7 6 root 1 2 3 4 5 7 6 root 1 2 3 4 5 7 6

Inorder Traversal 1 2 3 4 5 7 6 root 1 2 3 4 5 7 6 root 1 2 3 4 5 7 6

Inorder Traversal 1 2 3 4 5 7 6 root 1 2 3 4 5 7 6 root

Terima kasih Semoga sukses