SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Temporal Graph : Storage, 
Traversal, Path discovery 
Submitted by 
Vinay Sarda 
M.Tech(CSE) II Year 
13535054 
Under the guidance of 
Prof. A.K. Sarje
Outline 
 Introduction 
 Graph Database 
 What is a Temporal Graph 
 Traversal in Temporal Path 
 Types of Path in Temporal Graph 
 Algorithms to determine different temporal path 
 Conclusion
Introduction 
 Graph database are best tool for handling highly connected data 
 In Relational or Hierarchical database, some entities have precedence over other 
like key, parent etc. 
 In Graph No node or edge have a higher precedence over other 
 Graph DB are NOSQL, doesn’t have rigid schema 
 Graph uses structures like nodes, edges are used to store and represent data 
 No need to look-up for neighbours as it provides index-free adjacency 
 Graph DB can be used in to determine whether two concept are related or not, or 
is it possible to reach from source to destination within specified interval etc.
Example -Graph 
Roy is boy 
Mary is a girl 
Roy and Mary are friends
Accessing Graph DB 
 TinkerPop is an open source toolkit that provides 
interfaces to implement Blueprint 
 Blueprint is a generic graph API, serves as a base layer for 
graph DB architectures 
 Pipes is a dataflow network using process graphs 
 Gremlin is a graph traversal language for accessing and 
manipulating graphs 
 Frames allows developer to frame a graph element in 
terms of java interface 
 Furnace is a graph algorithm package 
 Rexster is a graph server that exploits blueprint via REST 
 Example Titan Graph DB 
TinkerPop Stack
Temporal Graph 
 Nodes and Edges are active for a specific time instance 
 Visiting nodes or edges at any time other than specific time instance is not possible 
 Example – SMS Network, flight scheduling, stock exchange network 
 Did mail from A to D had any impact on mail send from D to B 
Sender Receipent Time 
A B 0 
A C,E 1 
E D 3 
B C 5 
B D 9 
D B 14 
A D 20 
C A 
B D E 
1 
C A 
5 0 
20 
1 
9 
B D E 
14 
3 
Non-Temporal Graph Temporal Graph
Temporal Graph Traversal 
 Depth First Traversal 
 Temporal Constraint – In traversal from node a to e set of edges {(a,b,1),(b,e,6)} is valid, 
but edge set {(a,b,9),(b,e,6)} is not 
 Multiple edges – When multiple edges occur among the same pair of nodes, only one 
edge has to be chosen avoiding combinatorial effect 
 Edge with highest timestamp value (most recent connection) 
 Edge with lowest timestamp value (first connection) 
A 
B C 
E 
D 
F 
3 
2 
8 
6 
7 
1 
4 
5 
9
Depth First Traversal 
 Create a DFS tree rooted at node ‘a’ with lowest timestamp value 
 Initially every node’s visiting time is infinite 
 At node ‘a’, Eset = {(a,b,9), (a,b,1), (a,e,8), (a,c,2)} 
 Take edge (a,b,1) and visit node ‘b’ and mark time 1 
 Now Eset = {(b,d,7), (b,e,6)} and take edge (b,e,6), mark time t[e] = 6, and then (b,d,7), mark 
time t[d] = 7, and so on 
a 
b c 
e 
d 
2 
7 
1 
5 
a 
c 
e 
b 
d 
3 f 
2 
8 
6 
7 
1 
4 
9 
5 
6
Breadth First Traversal 
 Challenges 
 Temporal Constraint 
 Edges (b, d, 3) and (d, e, 3) forms a valid set of consecutive edges, but (c, d, 5), (d, e, 3) doesn’t. 
 Smallest path may not be earliest path 
 Path from a to d takes only one hop at time t = 7, while the earliest time at which d can be reached from 
a is 3 using edges (a, b, 2) and (b, d, 3) 
 If we mark node ‘d’ using edge a-d and don’t consider it again then ‘e’ cannot be reached 
 Multiple occurrences of a node are possible 
 Terminology 
 u – node 
 dist(u) – distance of node u from source s 
 σ(u) – earliest arrival time to reach node u from source node s 
 p(u) – parent node of u 
 Temporal edge is denoted as (u, v, t) 
a 
b c 
d 
e 
2 
5 
4 
7 
3 5 
3
 While Q is not empty for each node v 
 If v is not in Q (whether v has been visited or not) traverse e, and if σ(v) > t, then visit v 
and push (v, dist(v) = dist(u) + 1, σ (v) = t, p(v) = u) into Q. 
 Else 
 If there exists (v, dist(v), σ (v), p(v)) in Q such that dist(v) = dist(u) + 1: traverse e, and if σ(v) > t, 
then visit v and update σ(v) = t and p(v) = u in Q 
 Else (i.e., dist(v) = dist(u)): traverse e, and if σ(v) > t, then visit v and push (v, dist(v) = dist(u) + 1, 
σ (v) = t, p(v) = u) into Q. 
a 
b c 
d 
e 
2 
5 
4 
7 
3 5 
3 
c 
a 
b 
d 
e 
2 
4 
3 
d 
7 
3 
(a, 0, 1, φ) (b, 1, 2, a) (d, 1, 7, a) (c, 1, 4, a) (d, 2, 3, b) (e, 3, 3, d) 
Q (u, dist(u), σ(u), p(v))
Paths in Temporal Graph 
 A path ρ = {(s, u1, t1), (u1, u2, t2), (u2, u3, t3),……..,(ui-1, ui, ti), ….. (un-1 ,d, tn)} from 
source s to destination d is a temporal path if ti ≤ ti+1 
 Terminology 
 Pset - set of all paths from source s to destination d 
 [ta, tb] – time interval 
 t[u] – time at which node u can be reached from source s 
 tstart(ρ) - timestamp of a path ρ at which it starts at source s 
 tend(ρ) - timestamp of a path ρ at which it ends at destination d 
 dist(ρ) - number of nodes in path ρ 
 duration(ρ) – time taken by path ρ to reach destination node from source node, tend(ρ) - 
tstart(ρ) 
 Transition time – time taken to reach from node to its neighbour node (λ), by default 
assumed to be 1
 Foremost – In a given interval, path that reaches destination as early 
as possible, path ρ ∈ Pset is a foremost path if all path ρ’ ∈ Pset, such 
that tend (ρ’) ≤ tend (ρ) 
 Example – Pset(A,H) = {{(A,B,1), (B,H,3)}, {(A,B,2), (B,H,3)}, {(A,C,4), 
(C,H,6)}}, but only A-B-H is the foremost path 
 Latest- departure path - In a given interval, path that reaches 
destination as early as possible, path ρ ∈ Pset is a latest-departure 
path, if all path ρ’ ∈ Pset, such that tstart (ρ’) ≤ tstart (ρ) 
 Example - Pset(A,H) = {{(A,B,1), (B,H,3)}, {(A,B,2), (B,H,3)}, {(A,C,4), 
(C,H,6)}}, but only A-C-H is the latest-departure path 
 Fastest path – Path that spends minimum time to reach destination d 
from source s, path ρ ∈ Pset is a fastest path if for all path ρ ∈ Pset, 
duration (ρ) <= duration (ρ’) 
 Example – Pset(B,K) = ({(B,H,3),(H,K,7)}, {(B,G,3),(G,K,6)}}, fastest path is 
B-G-K as it takes only 3 units of time 
A 
1 
2 
4 
2 
3 
B C F 
3 
3 
6 5 
G H I 
6 
2 7 8 9 
J K L
 Shortest Path – Path that takes minimum distance to reach the 
destination, path ρ ∈ Pset is a shortest temporal path if for all 
path ρ’ ∈ Pset, dist (ρ) ≤ dist (ρ′) 
 Example – Pset (A,I) = {(A→I), (A→F →J→I)}, then shortest path 
from source A to destination I is A→I 
 Most recent path – path where source and destination node are 
connected using edges with recent timestamp 
 Example – Among two paths from A to K { {(A,B,1), (B,G,3), 
(G,K,6)}, {(A,C,4), (C,H,6), (H,K,7)} }, path A-C-H-K is most recent 
path 
 Edge Constrained Path – path from s to d where adjacent edges 
have timestamp difference lower than certain threshold value 
 Example - Pset(A,L) = {{(A,F,3), (F,I,5), (I,L,8)}, {(A,F,3), (F,I,5), (I,L,9)}, 
{(A,I,2), (I,L,8)}, {(A,I,2), (I,L,9)}} with threshold value of 3 only path 
A-F-I-L satisfies the constraint 
A 
1 
2 
4 
2 
3 
B C F 
3 
3 
6 5 
G H I 
6 
2 7 8 9 
J K L
Observation 
 Optimal path in Temporal Graph v/s Non-Temporal Graph 
 Optimal path in Non-Temporal Graph has property that sub-path of optimal path is 
always optimal 
 But it doesn’t holds in case of Temporal Graph, example shortest path 
A 
B 
C 
D 
2 
3 
7 
4
Temporal Path Discovery Techniques 
 Stream Representation of Temporal Graph 
 Transformation Graph
Stream Representation 
 Edge sequence in the order of their creation is called stream representation of 
edges in a temporal graph 
 Example – {(A→B)/2, (B→C)/3, (C→D)/4, (A→C)/7} 
A 
B 
C 
D 
2 
3 
7 
4
Foremost Path 
 Foremost Path for node ‘s’ in time interval [ta,tb] 
 For each node u in graph G t[u] = ∞ 
 Considering each edge in the sequence in the order 
 Check for two conditions if true then update t[v] = t+λ 
 t+λ ≤ tb and t ≥ t[u] 
 t+λ < t[v] 
 if t+ λ > tb then exit
Example 
 Edge representation is {(a, b, 1, λ), (a, c, 2, λ), (d, f, 3, λ), (b, d, 7, λ)} 
 Foremost path for node ‘a’ in [1,4] assuming λ = 1 
 For all node t[u] =∞ 
 Mark t[a] = 0 
 For edge (a, b, 1, 1), t + λ = 2, satisfies conditions, update t[b] = 2 
 For edge (a, c, 2, 1), t + λ = 3, satisfies conditions, update t[c] = 3 
 For edge (d, f, 3, 1), t + λ = 4, doesn’t satisfies condition t ≥ t[d] as t[d] = ∞ and t = 
3 
t+λ ≤ tb and t ≥ t[u] 
t+λ < t[v] 
a 
c 
b 
d f 
3 
2 
7 
1 
∞ 
∞ 
∞ 
∞ ∞ 
0 a 
3 
c 
b 
d f 
3 
2 
7 
1 
2 ∞ ∞
Fastest Path 
 Lv – sorted list of foremost time for each node v from source node ‘s is maintained, 
(s[v], a[v]), where s[v] represents start time from ‘s’ and a[v] arrival time at v 
 If s’[v] > s[v] and a’[v] ≤ a[v], or s’[v] = s[v] and a’[v] < a[v], then (s’[v], a’[v]) 
dominates (s[v], a[v]) 
A 
1 
2 
1,1 2,2 
B D 
3 
5 
C E 
4 
5 
F 
6 
1,3 
1,4 
2,5 
2,6 
S.No. s[v] a[v] 
a 1 4 
b 2 4 
c 4 6 
d 4 5
Transformation Graph 
 Two Step process 
 Node Creation - for each node in V create nodes in V’ for each oncoming (V’in) and 
outgoing edge (V’out) with distinct label as (name , time) 
 Edge Creation – 
 For each node (v, tin) in V’in(v), add an directed edge from (v, tin) to (v, tout) ∈ V’out(v), such 
that tout is minimum in V’out(v), tout ≥ tin. and no other edge from (v, t’in) to (v, tout) is added 
to G’. 
 Given V’in(v) = {(v, t1), (v, t2), (v, t3), ….,(v, tk)}, where t1 ≤ t2 ≤ t3 ≤ …..tk, then add an edge for 
(v, ti) to (v, ti+1) for 1 ≤ i ≤ k. with weight 0. Similarly add edges for V’out(v). 
 For each edge e = <x, y, t, λ> ∈ E, add a directed edge from (x, t) ∈ V’out(x) to (v, t+ λ) ∈ 
V’out(y).
4 
a’,0 
b,2 
1 0 1 
b,3 
0 0 
c,3 
c,5 
f,6 
f,7 
g,8 
0 
0 
0 
1 
0 0 
1 
1 
0 0 0 
1 
1 
a 
1 
2 2 
b c 
f g 
5 
6 
7 
Example 
Vout 
Vin 
Edge in original 
graph 
Within Vin/Vout 
From Vin to Vout
Foremost Path 
 Process the transformed graph G’ for a simple BFS Traversal 
 If the time t of any node is not in interval, then stop the BFS from that node 
 The minimum time of all the nodes visited (v, t) in G’ is the foremost time from a to 
v in G’ 
 From node a, in first round we visit (b, 2), (b, 3), (c, 3), and (c, 5) 
 Thus, the foremost time from a to b is 2, and from a to c is 3 and so on
Cost Optimal Path with time constraint 
 A graph in which cost of an edge changes with time is called time dependent 
graph 
 Two factors are considered in time dependent graph 
 Time 
 Cost of path 
 Constraints 
 Departure time from source and arrival time at destination must be within specified 
interval 
 Cost of the path must be minimum 
 Problem of finding cost-optimal path is 
 Optimal path from source to destination 
 Optimal waiting time at each node
 Earliest arrival time for each node is calculated so , λ1 = 0, λ2 = 
10, λ3 = 15 and λ4 = 25 and time domain of g1(t), g2(t), g3(t) and 
g4(t) are [0, 60], [10, 60], [15, 60] and [25, 60] respectively 
 Initially ti for all node is infinite except for source s 
 Priority Q is maintained containing all nodes with respect to 
their ti 
 In first iteration, v1 is dequeued as t1= 0 is minimum 
 g2(t) and g3(t) are computed and v1 is removed from Q 
 t2 = 20 and t3 = 5 are set 
 In second iteration, v3, is dequeued from Q 
 As T3 = 30, so S3 is updated as [30,60] 
 g4(t) is updated and t3 = 20 
 In third iteration, v2 is dequeued 
 g3(t) and g4(t) are computed and v2 is removed from Q 
 Similarly v3 is dequeued again in fourth iteration and v4 is 
dequeued in fifth iteration, and thus algorithm terminates
Conclusion 
 Graph DB used to store connected data and different technologies used to access 
them 
 Temporal Graph are used to withhold the temporal information about the data 
 Breadth first and depth traversal techniques on Temporal Graph 
 Different temporal paths and algorithms to determine those path
Thank You 
Q & A

Weitere ähnliche Inhalte

Was ist angesagt?

Algorithm to count number of disjoint paths
Algorithm to count number of disjoint pathsAlgorithm to count number of disjoint paths
Algorithm to count number of disjoint pathsSujith Jay Nair
 
Johnson's algorithm
Johnson's algorithmJohnson's algorithm
Johnson's algorithmKiran K
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treeoneous
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Mohanlal Sukhadia University (MLSU)
 
A Note on Latent LSTM Allocation
A Note on Latent LSTM AllocationA Note on Latent LSTM Allocation
A Note on Latent LSTM AllocationTomonari Masada
 
Volume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensionsVolume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensionsVissarion Fisikopoulos
 
Shortest path search for real road networks and dynamic costs with pgRouting
Shortest path search for real road networks and dynamic costs with pgRoutingShortest path search for real road networks and dynamic costs with pgRouting
Shortest path search for real road networks and dynamic costs with pgRoutingantonpa
 
Sensors and Samples: A Homological Approach
Sensors and Samples:  A Homological ApproachSensors and Samples:  A Homological Approach
Sensors and Samples: A Homological ApproachDon Sheehy
 
ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1
ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1
ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1zukun
 
Pathfinding - Part 1: Α* heuristic search
Pathfinding - Part 1: Α* heuristic searchPathfinding - Part 1: Α* heuristic search
Pathfinding - Part 1: Α* heuristic searchStavros Vassos
 

Was ist angesagt? (20)

Algorithm to count number of disjoint paths
Algorithm to count number of disjoint pathsAlgorithm to count number of disjoint paths
Algorithm to count number of disjoint paths
 
Johnson's algorithm
Johnson's algorithmJohnson's algorithm
Johnson's algorithm
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
 
Shortest path
Shortest pathShortest path
Shortest path
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
 
A superglue for string comparison
A superglue for string comparisonA superglue for string comparison
A superglue for string comparison
 
A Note on Latent LSTM Allocation
A Note on Latent LSTM AllocationA Note on Latent LSTM Allocation
A Note on Latent LSTM Allocation
 
A Note on TopicRNN
A Note on TopicRNNA Note on TopicRNN
A Note on TopicRNN
 
Chapter 23 aoa
Chapter 23 aoaChapter 23 aoa
Chapter 23 aoa
 
5th Semester Electronic and Communication Engineering (2013-June) Question Pa...
5th Semester Electronic and Communication Engineering (2013-June) Question Pa...5th Semester Electronic and Communication Engineering (2013-June) Question Pa...
5th Semester Electronic and Communication Engineering (2013-June) Question Pa...
 
Volume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensionsVolume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensions
 
Chapter 25 aoa
Chapter 25 aoaChapter 25 aoa
Chapter 25 aoa
 
Shortest path search for real road networks and dynamic costs with pgRouting
Shortest path search for real road networks and dynamic costs with pgRoutingShortest path search for real road networks and dynamic costs with pgRouting
Shortest path search for real road networks and dynamic costs with pgRouting
 
Sensors and Samples: A Homological Approach
Sensors and Samples:  A Homological ApproachSensors and Samples:  A Homological Approach
Sensors and Samples: A Homological Approach
 
Chapter 26 aoa
Chapter 26 aoaChapter 26 aoa
Chapter 26 aoa
 
Adsa u2 ver 1.0.
Adsa u2 ver 1.0.Adsa u2 ver 1.0.
Adsa u2 ver 1.0.
 
M4 heuristics
M4 heuristicsM4 heuristics
M4 heuristics
 
ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1
ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1
ECCV2008: MAP Estimation Algorithms in Computer Vision - Part 1
 
Pathfinding - Part 1: Α* heuristic search
Pathfinding - Part 1: Α* heuristic searchPathfinding - Part 1: Α* heuristic search
Pathfinding - Part 1: Α* heuristic search
 
Dijksatra
DijksatraDijksatra
Dijksatra
 

Ähnlich wie Temporal graph

Single source shortes path in dag
Single source shortes path in dagSingle source shortes path in dag
Single source shortes path in dagKiran K
 
All pair shortest path by Sania Nisar
All pair shortest path by Sania NisarAll pair shortest path by Sania Nisar
All pair shortest path by Sania NisarSania Nisar
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaPyData
 
Lecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptLecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptWahyuAde4
 
Problem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - GraphsProblem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - GraphsYi-Lung Tsai
 
Tree distance algorithm
Tree distance algorithmTree distance algorithm
Tree distance algorithmTrector Rancor
 
Design and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment HelpDesign and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment HelpProgramming Homework Help
 
Unit26 shortest pathalgorithm
Unit26 shortest pathalgorithmUnit26 shortest pathalgorithm
Unit26 shortest pathalgorithmmeisamstar
 
Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanationsGopi Saiteja
 

Ähnlich wie Temporal graph (20)

Single source shortes path in dag
Single source shortes path in dagSingle source shortes path in dag
Single source shortes path in dag
 
Graphs
GraphsGraphs
Graphs
 
Computer Science Assignment Help
Computer Science Assignment Help Computer Science Assignment Help
Computer Science Assignment Help
 
All pair shortest path by Sania Nisar
All pair shortest path by Sania NisarAll pair shortest path by Sania Nisar
All pair shortest path by Sania Nisar
 
Floyd aaaaaa
Floyd aaaaaaFloyd aaaaaa
Floyd aaaaaa
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
 
Graps 2
Graps 2Graps 2
Graps 2
 
Lecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.pptLecture_10_Parallel_Algorithms_Part_II.ppt
Lecture_10_Parallel_Algorithms_Part_II.ppt
 
Dijkstra
DijkstraDijkstra
Dijkstra
 
d
dd
d
 
Logistics Management Assignment Help
Logistics Management Assignment Help Logistics Management Assignment Help
Logistics Management Assignment Help
 
Graph
GraphGraph
Graph
 
Design & Analysis of Algorithms Assignment Help
Design & Analysis of Algorithms Assignment HelpDesign & Analysis of Algorithms Assignment Help
Design & Analysis of Algorithms Assignment Help
 
Problem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - GraphsProblem Solving with Algorithms and Data Structure - Graphs
Problem Solving with Algorithms and Data Structure - Graphs
 
Tree distance algorithm
Tree distance algorithmTree distance algorithm
Tree distance algorithm
 
Design and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment HelpDesign and Analysis of Algorithms Assignment Help
Design and Analysis of Algorithms Assignment Help
 
Ppt 1
Ppt 1Ppt 1
Ppt 1
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Unit26 shortest pathalgorithm
Unit26 shortest pathalgorithmUnit26 shortest pathalgorithm
Unit26 shortest pathalgorithm
 
Answers withexplanations
Answers withexplanationsAnswers withexplanations
Answers withexplanations
 

Kürzlich hochgeladen

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Kürzlich hochgeladen (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

Temporal graph

  • 1. Temporal Graph : Storage, Traversal, Path discovery Submitted by Vinay Sarda M.Tech(CSE) II Year 13535054 Under the guidance of Prof. A.K. Sarje
  • 2. Outline  Introduction  Graph Database  What is a Temporal Graph  Traversal in Temporal Path  Types of Path in Temporal Graph  Algorithms to determine different temporal path  Conclusion
  • 3. Introduction  Graph database are best tool for handling highly connected data  In Relational or Hierarchical database, some entities have precedence over other like key, parent etc.  In Graph No node or edge have a higher precedence over other  Graph DB are NOSQL, doesn’t have rigid schema  Graph uses structures like nodes, edges are used to store and represent data  No need to look-up for neighbours as it provides index-free adjacency  Graph DB can be used in to determine whether two concept are related or not, or is it possible to reach from source to destination within specified interval etc.
  • 4. Example -Graph Roy is boy Mary is a girl Roy and Mary are friends
  • 5. Accessing Graph DB  TinkerPop is an open source toolkit that provides interfaces to implement Blueprint  Blueprint is a generic graph API, serves as a base layer for graph DB architectures  Pipes is a dataflow network using process graphs  Gremlin is a graph traversal language for accessing and manipulating graphs  Frames allows developer to frame a graph element in terms of java interface  Furnace is a graph algorithm package  Rexster is a graph server that exploits blueprint via REST  Example Titan Graph DB TinkerPop Stack
  • 6. Temporal Graph  Nodes and Edges are active for a specific time instance  Visiting nodes or edges at any time other than specific time instance is not possible  Example – SMS Network, flight scheduling, stock exchange network  Did mail from A to D had any impact on mail send from D to B Sender Receipent Time A B 0 A C,E 1 E D 3 B C 5 B D 9 D B 14 A D 20 C A B D E 1 C A 5 0 20 1 9 B D E 14 3 Non-Temporal Graph Temporal Graph
  • 7. Temporal Graph Traversal  Depth First Traversal  Temporal Constraint – In traversal from node a to e set of edges {(a,b,1),(b,e,6)} is valid, but edge set {(a,b,9),(b,e,6)} is not  Multiple edges – When multiple edges occur among the same pair of nodes, only one edge has to be chosen avoiding combinatorial effect  Edge with highest timestamp value (most recent connection)  Edge with lowest timestamp value (first connection) A B C E D F 3 2 8 6 7 1 4 5 9
  • 8. Depth First Traversal  Create a DFS tree rooted at node ‘a’ with lowest timestamp value  Initially every node’s visiting time is infinite  At node ‘a’, Eset = {(a,b,9), (a,b,1), (a,e,8), (a,c,2)}  Take edge (a,b,1) and visit node ‘b’ and mark time 1  Now Eset = {(b,d,7), (b,e,6)} and take edge (b,e,6), mark time t[e] = 6, and then (b,d,7), mark time t[d] = 7, and so on a b c e d 2 7 1 5 a c e b d 3 f 2 8 6 7 1 4 9 5 6
  • 9. Breadth First Traversal  Challenges  Temporal Constraint  Edges (b, d, 3) and (d, e, 3) forms a valid set of consecutive edges, but (c, d, 5), (d, e, 3) doesn’t.  Smallest path may not be earliest path  Path from a to d takes only one hop at time t = 7, while the earliest time at which d can be reached from a is 3 using edges (a, b, 2) and (b, d, 3)  If we mark node ‘d’ using edge a-d and don’t consider it again then ‘e’ cannot be reached  Multiple occurrences of a node are possible  Terminology  u – node  dist(u) – distance of node u from source s  σ(u) – earliest arrival time to reach node u from source node s  p(u) – parent node of u  Temporal edge is denoted as (u, v, t) a b c d e 2 5 4 7 3 5 3
  • 10.  While Q is not empty for each node v  If v is not in Q (whether v has been visited or not) traverse e, and if σ(v) > t, then visit v and push (v, dist(v) = dist(u) + 1, σ (v) = t, p(v) = u) into Q.  Else  If there exists (v, dist(v), σ (v), p(v)) in Q such that dist(v) = dist(u) + 1: traverse e, and if σ(v) > t, then visit v and update σ(v) = t and p(v) = u in Q  Else (i.e., dist(v) = dist(u)): traverse e, and if σ(v) > t, then visit v and push (v, dist(v) = dist(u) + 1, σ (v) = t, p(v) = u) into Q. a b c d e 2 5 4 7 3 5 3 c a b d e 2 4 3 d 7 3 (a, 0, 1, φ) (b, 1, 2, a) (d, 1, 7, a) (c, 1, 4, a) (d, 2, 3, b) (e, 3, 3, d) Q (u, dist(u), σ(u), p(v))
  • 11. Paths in Temporal Graph  A path ρ = {(s, u1, t1), (u1, u2, t2), (u2, u3, t3),……..,(ui-1, ui, ti), ….. (un-1 ,d, tn)} from source s to destination d is a temporal path if ti ≤ ti+1  Terminology  Pset - set of all paths from source s to destination d  [ta, tb] – time interval  t[u] – time at which node u can be reached from source s  tstart(ρ) - timestamp of a path ρ at which it starts at source s  tend(ρ) - timestamp of a path ρ at which it ends at destination d  dist(ρ) - number of nodes in path ρ  duration(ρ) – time taken by path ρ to reach destination node from source node, tend(ρ) - tstart(ρ)  Transition time – time taken to reach from node to its neighbour node (λ), by default assumed to be 1
  • 12.  Foremost – In a given interval, path that reaches destination as early as possible, path ρ ∈ Pset is a foremost path if all path ρ’ ∈ Pset, such that tend (ρ’) ≤ tend (ρ)  Example – Pset(A,H) = {{(A,B,1), (B,H,3)}, {(A,B,2), (B,H,3)}, {(A,C,4), (C,H,6)}}, but only A-B-H is the foremost path  Latest- departure path - In a given interval, path that reaches destination as early as possible, path ρ ∈ Pset is a latest-departure path, if all path ρ’ ∈ Pset, such that tstart (ρ’) ≤ tstart (ρ)  Example - Pset(A,H) = {{(A,B,1), (B,H,3)}, {(A,B,2), (B,H,3)}, {(A,C,4), (C,H,6)}}, but only A-C-H is the latest-departure path  Fastest path – Path that spends minimum time to reach destination d from source s, path ρ ∈ Pset is a fastest path if for all path ρ ∈ Pset, duration (ρ) <= duration (ρ’)  Example – Pset(B,K) = ({(B,H,3),(H,K,7)}, {(B,G,3),(G,K,6)}}, fastest path is B-G-K as it takes only 3 units of time A 1 2 4 2 3 B C F 3 3 6 5 G H I 6 2 7 8 9 J K L
  • 13.  Shortest Path – Path that takes minimum distance to reach the destination, path ρ ∈ Pset is a shortest temporal path if for all path ρ’ ∈ Pset, dist (ρ) ≤ dist (ρ′)  Example – Pset (A,I) = {(A→I), (A→F →J→I)}, then shortest path from source A to destination I is A→I  Most recent path – path where source and destination node are connected using edges with recent timestamp  Example – Among two paths from A to K { {(A,B,1), (B,G,3), (G,K,6)}, {(A,C,4), (C,H,6), (H,K,7)} }, path A-C-H-K is most recent path  Edge Constrained Path – path from s to d where adjacent edges have timestamp difference lower than certain threshold value  Example - Pset(A,L) = {{(A,F,3), (F,I,5), (I,L,8)}, {(A,F,3), (F,I,5), (I,L,9)}, {(A,I,2), (I,L,8)}, {(A,I,2), (I,L,9)}} with threshold value of 3 only path A-F-I-L satisfies the constraint A 1 2 4 2 3 B C F 3 3 6 5 G H I 6 2 7 8 9 J K L
  • 14. Observation  Optimal path in Temporal Graph v/s Non-Temporal Graph  Optimal path in Non-Temporal Graph has property that sub-path of optimal path is always optimal  But it doesn’t holds in case of Temporal Graph, example shortest path A B C D 2 3 7 4
  • 15. Temporal Path Discovery Techniques  Stream Representation of Temporal Graph  Transformation Graph
  • 16. Stream Representation  Edge sequence in the order of their creation is called stream representation of edges in a temporal graph  Example – {(A→B)/2, (B→C)/3, (C→D)/4, (A→C)/7} A B C D 2 3 7 4
  • 17. Foremost Path  Foremost Path for node ‘s’ in time interval [ta,tb]  For each node u in graph G t[u] = ∞  Considering each edge in the sequence in the order  Check for two conditions if true then update t[v] = t+λ  t+λ ≤ tb and t ≥ t[u]  t+λ < t[v]  if t+ λ > tb then exit
  • 18. Example  Edge representation is {(a, b, 1, λ), (a, c, 2, λ), (d, f, 3, λ), (b, d, 7, λ)}  Foremost path for node ‘a’ in [1,4] assuming λ = 1  For all node t[u] =∞  Mark t[a] = 0  For edge (a, b, 1, 1), t + λ = 2, satisfies conditions, update t[b] = 2  For edge (a, c, 2, 1), t + λ = 3, satisfies conditions, update t[c] = 3  For edge (d, f, 3, 1), t + λ = 4, doesn’t satisfies condition t ≥ t[d] as t[d] = ∞ and t = 3 t+λ ≤ tb and t ≥ t[u] t+λ < t[v] a c b d f 3 2 7 1 ∞ ∞ ∞ ∞ ∞ 0 a 3 c b d f 3 2 7 1 2 ∞ ∞
  • 19. Fastest Path  Lv – sorted list of foremost time for each node v from source node ‘s is maintained, (s[v], a[v]), where s[v] represents start time from ‘s’ and a[v] arrival time at v  If s’[v] > s[v] and a’[v] ≤ a[v], or s’[v] = s[v] and a’[v] < a[v], then (s’[v], a’[v]) dominates (s[v], a[v]) A 1 2 1,1 2,2 B D 3 5 C E 4 5 F 6 1,3 1,4 2,5 2,6 S.No. s[v] a[v] a 1 4 b 2 4 c 4 6 d 4 5
  • 20. Transformation Graph  Two Step process  Node Creation - for each node in V create nodes in V’ for each oncoming (V’in) and outgoing edge (V’out) with distinct label as (name , time)  Edge Creation –  For each node (v, tin) in V’in(v), add an directed edge from (v, tin) to (v, tout) ∈ V’out(v), such that tout is minimum in V’out(v), tout ≥ tin. and no other edge from (v, t’in) to (v, tout) is added to G’.  Given V’in(v) = {(v, t1), (v, t2), (v, t3), ….,(v, tk)}, where t1 ≤ t2 ≤ t3 ≤ …..tk, then add an edge for (v, ti) to (v, ti+1) for 1 ≤ i ≤ k. with weight 0. Similarly add edges for V’out(v).  For each edge e = <x, y, t, λ> ∈ E, add a directed edge from (x, t) ∈ V’out(x) to (v, t+ λ) ∈ V’out(y).
  • 21. 4 a’,0 b,2 1 0 1 b,3 0 0 c,3 c,5 f,6 f,7 g,8 0 0 0 1 0 0 1 1 0 0 0 1 1 a 1 2 2 b c f g 5 6 7 Example Vout Vin Edge in original graph Within Vin/Vout From Vin to Vout
  • 22. Foremost Path  Process the transformed graph G’ for a simple BFS Traversal  If the time t of any node is not in interval, then stop the BFS from that node  The minimum time of all the nodes visited (v, t) in G’ is the foremost time from a to v in G’  From node a, in first round we visit (b, 2), (b, 3), (c, 3), and (c, 5)  Thus, the foremost time from a to b is 2, and from a to c is 3 and so on
  • 23. Cost Optimal Path with time constraint  A graph in which cost of an edge changes with time is called time dependent graph  Two factors are considered in time dependent graph  Time  Cost of path  Constraints  Departure time from source and arrival time at destination must be within specified interval  Cost of the path must be minimum  Problem of finding cost-optimal path is  Optimal path from source to destination  Optimal waiting time at each node
  • 24.  Earliest arrival time for each node is calculated so , λ1 = 0, λ2 = 10, λ3 = 15 and λ4 = 25 and time domain of g1(t), g2(t), g3(t) and g4(t) are [0, 60], [10, 60], [15, 60] and [25, 60] respectively  Initially ti for all node is infinite except for source s  Priority Q is maintained containing all nodes with respect to their ti  In first iteration, v1 is dequeued as t1= 0 is minimum  g2(t) and g3(t) are computed and v1 is removed from Q  t2 = 20 and t3 = 5 are set  In second iteration, v3, is dequeued from Q  As T3 = 30, so S3 is updated as [30,60]  g4(t) is updated and t3 = 20  In third iteration, v2 is dequeued  g3(t) and g4(t) are computed and v2 is removed from Q  Similarly v3 is dequeued again in fourth iteration and v4 is dequeued in fifth iteration, and thus algorithm terminates
  • 25. Conclusion  Graph DB used to store connected data and different technologies used to access them  Temporal Graph are used to withhold the temporal information about the data  Breadth first and depth traversal techniques on Temporal Graph  Different temporal paths and algorithms to determine those path
  • 26. Thank You Q & A

Hinweis der Redaktion

  1. While Q is not empty, do: (a) Pop (u, dist(u), σ (u), p(u)) from Q; (b) Let Eu,v be the set of temporal edges going from u to v, where each edge (u, v, t) ∈ Eu,v has not been traversed before and σ(u) ≤ t. For each out-neighbor v of u, where Eu,v 6 = ∅, do: i. Let e = (u, v, t) be the edge in Eu,v where t = min{t ′ : (u, v, t ′ ) ∈ Eu,v}. ii. If v is not in Q (whether v has been visited or not): traverse e, and if σ(v) > t, then visit v and push (v, dist(v) = dist(u) + 1, σ (v) = t, p(v) = u) into Q. iii. Else: A. If there exists (v, dist(v), σ (v), p(v)) in Q such that dist(v) = dist(u) + 1: traverse e, and if σ(v) > t, then visit v and update σ(v) = t and p(v) = u in Q. B. Else (i.e., dist(v) = dist(u)): traverse e, and if σ(v) > t, then visit v and push (v, dist(v) = dist(u) + 1, σ (v) = t, p(v) = u) into Q. The BFS constructs a BFS tree, T , which is rooted at s, where the set of vertices in T is defined as ({s} ∪ {v : v is visited in the BFS and p(v) 6 = φ}, and the set of edges in T is defined as {(p(v), v ) : v in T and p(v) 6 = φ