Presentation is loading. Please wait.

Presentation is loading. Please wait.

+ GRAPH Algorithm Dikompilasi dari banyak sumber.

Similar presentations


Presentation on theme: "+ GRAPH Algorithm Dikompilasi dari banyak sumber."— Presentation transcript:

1 + GRAPH Algorithm Dikompilasi dari banyak sumber

2 Graph Data Model technically simpler to treat than for example XML. databases and schemas are treated in the same framework: graphs

3 What are Graphs good for Genealogy Time series data Product catalogue Web analytics especially bioinformatics Indexing your slow RDBMS Recommendations Business intelligence Social computing Geospatial MDM Systems management

4

5 DBMS Popularity

6

7

8 Dataset graph database… Bisa dari snap atau other dataset…

9

10 + Example of graph db

11 If a graph has one or more cycles, we say the graph is cyclic. If there are no cycles, the graph is said to be acyclic. Cyclic Graph

12 Example of cyclic graph (direct) Taken from

13 + Example of cyclic graph (indirect) However, one occasionally sees an indirect recursion, in which there is a cycle of length greater than 1. For instance, the graph PQR represents a function P that calls function Q, which calls function R, which calls function P.

14 + Cyclic in undirected graph

15 + Cyclic in undirected graph (cont..) In directed graph, if we want to state cyclic, we can simply define the initial and the end vertex. But in undirected graph, we just can define the length of the path.

16 + Implementation of graphs There are two standard ways to represent a graph. One, called adjacency lists, is familiar from the implementation of binary relations in general. The second, called adjacency matrices.

17 + Adjacency List Let nodes be named either by the integers 0,1,...,MAX − 1 or by an equivalent enumerated type. In general, we shall use node as the type of nodes, but we may suppose that NODE is a synonym for int.. This representation is called adjacency lists. We define linked lists of nodes by And then create an array LIST successors[MAX]; That is, the entry successors[u] contains a pointer to a linked list of all the successors of node u.

18 + Adjacency List: Example

19 + Adjacency Matrices Another common way to represent directed graphs is as adjacency matrices. We can create a two-dimensional array BOOLEAN arcs[MAX][MAX]; in which the value of arcs[u][v] is TRUE if there is an arc u → v, and FALSE if not.

20 + Adjacency Matrices: Example

21 + Comparison between List and Matrix

22 + In Out Degree (directed graph) The number of arcs out of a node v is called the out-degree of v. Thus, the out- degree of a node equals the length of its adjacency list; it also equals the number of 1’s in the row for v in the adjacency matrix. The number of arcs into node v is the in-degree of v. The in- degree measures the number of times v appears on the adjacency list of some node, and it is the number of 1’s found in the column for v in the adjacency matrix.

23 + Implementing Undirected Graphs If we use an adjacency matrix, the matrix is symmetric. That is, if we call the matrix edges, then edges[u][v] = edges[v][u].

24 +

25 + Adjacency List for undirected graph Figure 9.9 shows the representation by adjacency lists. In both cases, we are using an enumeration type enum CITYTYPE {Laie, Kaneohe, Honolulu, PearlCity, Maili, Wahiawa};

26 + Representing Labeled Graphs

27 + Single Relational, Directed Graph All vertices are homogenous in meaning—all vertices denote the same type of object (e.g. people, webpages, etc.). All edges are homogenous in meaning—all edges denote the same type of relationships (e.g. friendship, works with, etc.).

28 + Applications of Single-Relational Graphs Social: define how people interact (collaborators, friends, kins). Biological: define how biological components interact (protein, food chains, gene regulation). Transportation: define how cities are joined by air and road routes. Dependency: define how software modules, data sets, functions depend on each other. Technology: define the connectivity of Internet routers, web pages, etc. Language: define the relationships between words.

29 + The Limitation of Single-Relaional Graph Modelling Unfortunately, single-relational graphs are independent of each other. This is because G = (V, E)—there is only a single edge set E (i.e. a single type of relation).

30 + Numerous Algorithms for Single- Relational Graphs Geodesic: diameter, radius, eccentricity, closeness, betweenness, etc. Spectral: random walks, PageRank, eigenvector centrality, spreading activation, etc. Assortativity: scalar, categorical, hierarchal, etc.

31 + References Slide 2 s.d 19 diambil dari Graph Theory handbook by Keijo Ruohonen. 2013 Slide 20 s.d 23 diambil dari Problem-Solving using Graph Traversals oleh Marko Rodriguez, 2010.


Download ppt "+ GRAPH Algorithm Dikompilasi dari banyak sumber."

Similar presentations


Ads by Google