Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.
-
Upload
marjory-allen -
Category
Documents
-
view
220 -
download
0
Transcript of Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.
![Page 1: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/1.jpg)
Graph Theory
By:Maciej KicinskiChiu Ming Luk
![Page 2: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/2.jpg)
Extract Triple words
![Page 3: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/3.jpg)
Extract Triple words
![Page 4: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/4.jpg)
Extract Double words
![Page 5: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/5.jpg)
Extract Double words
![Page 6: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/6.jpg)
Adjacency-matrix Representation
![Page 7: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/7.jpg)
Adjacency-matrix Representation
![Page 8: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/8.jpg)
Adjacency-lists Representation
![Page 9: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/9.jpg)
Depth-First Search
![Page 10: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/10.jpg)
Depth-First Search
![Page 11: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/11.jpg)
Breath-First Search
![Page 12: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/12.jpg)
Breath-First Search
![Page 13: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/13.jpg)
Strongly connected Component
![Page 14: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/14.jpg)
Kosaraju's algorithm
• Let G be a directed graph and S be an empty stack.• While S does not contain all vertices:
– Choose an arbitrary vertex v not in S. Perform a depth-first search starting at v. Each time that depth-first search finishes expanding a vertex u, push u onto S.
• Reverse the directions of all arcs to obtain the transpose graph.• While S is nonempty:
– Pop the top vertex v from S. Perform a depth-first search starting at v. The set of visited vertices will give the strongly connected component containing v; record this and remove all these vertices from the graph G and the stack S.
![Page 15: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/15.jpg)
Kosaraju's algorithm
![Page 16: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/16.jpg)
Simplicial Complexes
S0 – 0 1 2 3 4 5 6 7S1 – {0,1} {0,2} {1,2} {3,4} {5,6} {5,7} {6,7}S2 - {5,6,7}
![Page 17: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/17.jpg)
Tarjan Algorithm
For a directed graph:Checks every edge starting from a nodeFor every node lead to by an edge, checks edges for
nodes that have not been checked yet repeats until every node that can be checked from these nodes has been check
All checked nodes are Strongly Connected.
Any node that could not have been reached is not strongly connected to the nodes reached.
![Page 18: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/18.jpg)
Tarjan Algorithm
To find Strong Connected Components(SCC)Take simplicial complexes:Δ0 – 0 1 2 3 4 5 6 7Δ1 – {0,1} {0,2} {1,2} {3,4} {5,6} {5,7} {6,7}Δ2 – {5,6,7}
And make each one a node with edges connecting relationΔ0 – 0 1 2 3 4 5 6 7Δ1 – 8 9 10 11 12 13 14Δ2 – 15
![Page 19: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/19.jpg)
Graph
Δ0 – 0 1 2 3 4 5 6 7Δ1 – {0,1} {0,2} {1,2} {3,4} {5,6} {5,7} {6,7}Δ2 - {5,6,7}
![Page 20: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/20.jpg)
Strongly Connected Components
Connected nodes are consider strongly connectedSCC 0 – 0 1 2 {0,1} {0,2} {1,2}SCC 1 – 3 4 {3,4}SCC 2 – 5 6 7 {5,6} {5,7} {6,7} {5,6,7}
![Page 21: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/21.jpg)
Simplicial Complex and SCC GraphCan reduce # of nodessince we know therelation in simplicial complexes we then only need to findrelation between the different complexes.
SCC 0 – {0,1} {0,2} ({1,2})SCC 1 – {3,4}SCC 2 – {5,6,7}
![Page 22: Graph Theory By: Maciej Kicinski Chiu Ming Luk. Extract Triple words.](https://reader036.fdocuments.net/reader036/viewer/2022062409/5697bff91a28abf838cbf8f5/html5/thumbnails/22.jpg)
Run Time
Tarjan Algorithm runs in O(e + n) time where e is edges and n is number of nodes
Sort – O(n*log(n)) but only on singlesBuild Nodes – O(n*log(n)) or O(n)Build Edges – O(n) orO(n*log(n))
Tarjan Algorithm finished on ≈1 mil nodes in less than a second.