Data Structure Graph Representation © Sekolah Tinggi Teknik Surabaya
Graph Definition Consisted of: Edges Vertices © Sekolah Tinggi Teknik Surabaya
Graph Data Structure Edge List Adjancency List Adjancency Matrix © Sekolah Tinggi Teknik Surabaya
Graph, an Example © Sekolah Tinggi Teknik Surabaya
Edge List Represent edges and vertices in an unordered list Edges are linked to vertices © Sekolah Tinggi Teknik Surabaya
Adjacency List (Simple) Adjacent vertices © Sekolah Tinggi Teknik Surabaya
Adjacency List © Sekolah Tinggi Teknik Surabaya
Adjacency Matrix (Simple) © Sekolah Tinggi Teknik Surabaya
Adjacency Matrix © Sekolah Tinggi Teknik Surabaya
Think! When a representation is appropriate? Graph Category Complexity Sparsity Graph Category Direction: Directed Undirected Weight Weighted Unweighted How to represent them? How to implement the representation? Define the classes! © Sekolah Tinggi Teknik Surabaya
Exercise Given a graph, define its representation in: Edge List Adjacency List Adjacency Matrix © Sekolah Tinggi Teknik Surabaya
Graph 1 © Sekolah Tinggi Teknik Surabaya
Graph 2 A B C D d3 © Sekolah Tinggi Teknik Surabaya