dynetx.algorithms.paths.temporal_dag¶
- dynetx.algorithms.paths.temporal_dag(G, u, v=None, start=None, end=None)¶
Creates a rooted temporal DAG assuming 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, default None
- 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
Returns¶
- DAG: a directed graph
A DAG rooted in u (networkx DiGraph object)
- sources: source node ids
List of temporal occurrences of u
- targets: target node ids
List of temporal occurrences of v
- node_type: type
network node_type
- tid_type: type
network temporal id type
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) >>> DAG, sources, targets, _, _ = al.temporal_dag(g, "D", "C", start=1, end=9)