Lecture 12 Graph Representation Sandy Ardianto & Erick Pranata © Sekolah Tinggi Teknik Surabaya 1
» Consisted of: ˃Edges ˃Vertices 2 © Sekolah Tinggi Teknik Surabaya
» Edge List » Adjancency List » Adjancency Matrix 3 © Sekolah Tinggi Teknik Surabaya
4
» Represent edges and vertices in an unordered list » Edges are linked to vertices 5 © Sekolah Tinggi Teknik Surabaya
» Adjacent vertices 6 © Sekolah Tinggi Teknik Surabaya
7
8
9
» When a representation is appropriate? ˃Complexity (Big-O Analysis) ˃Sparsity » Graph Category ˃Direction: +Directed +Undirected ˃Weight +Weighted +Unweighted » How to represent them? » How to implement the representation? Define the classes! 10 © Sekolah Tinggi Teknik Surabaya
» Given a graph, define its representation in: ˃Edge List ˃Adjacency List ˃Adjacency Matrix 11 © Sekolah Tinggi Teknik Surabaya
12 © Sekolah Tinggi Teknik Surabaya
13 © Sekolah Tinggi Teknik Surabaya