dynetx.algorithms.paths.time_respecting_paths¶
- dynetx.algorithms.paths.time_respecting_paths(G, u, v=None, start=None, end=None, sample=1)¶
Computes all the simple time respecting paths among u and v within [start, stop]. It assumes interaction chains of length 1 within each network snapshot.
Parameters¶
- Ga DynGraph or DynDiGraph object
The graph to use for computing DAG
- ua node id
A node in G
- va node id
A node in G
- starttemporal id
min temporal id for bounding the DAG, default None
- endtemporal id to conclude the search
max temporal id for bounding the DAG, default None
sample : percentage of connected node pairs for which compute the time respecting paths. Default 1.
Returns¶
- paths: dict
A dictionary that associate to each node pair (u,v) the list of time respecting paths connecting them.
Examples¶
>>> import dynetx as dn >>> g = dn.DynGraph() >>> g.add_interaction("A", "B", 1, 4) >>> g.add_interaction("B", "D", 2, 5) >>> g.add_interaction("A", "C", 4, 8) >>> g.add_interaction("B", "D", 2, 4) >>> g.add_interaction("B", "C", 6, 10) >>> g.add_interaction("B", "D", 2, 4) >>> g.add_interaction("A", "B", 7, 9) >>> paths = al.time_respecting_paths(g, "D", "C", start=1, end=9)