straph.dags package

Submodules

straph.dags.condensation_dag module

class straph.dags.condensation_dag.CondensationDag(id=None, times=None, c_nodes=None, c_links=None, id_comp_to_comp=None, node_to_id_comp=None, segmented_node_to_id_comp=None, adj_list=None)[source]

Bases: straph.dags.dag.Dag

all_fastest_paths(source, destination)[source]

Compute the fastest path between ‘source’ and ‘destination’

Parameters
  • source

  • destination

Returns

all_fastest_paths_ss(source)[source]

Compute the fastest path between ‘source’ and all other nodes (in condensation DAG)

Parameters

source

Returns

cluster_to_object()[source]
fastest_path(source, destination)[source]

Compute the fastest path between ‘source’ and ‘destination’

Parameters
  • source

  • destination

Returns

foremost_path(source, destination)[source]

Compute a foremost path between ‘source’ and ‘destination” starting at ‘begin time’.

Parameters
  • source

  • destination

Returns

get_stable_dag()[source]
is_reachable(source, target)[source]
latencies_ss(source)[source]
latency(source, destination)[source]
node_to_scc(n)[source]
path_induced_substream(path, node_to_label=None, path_bounds=None)[source]

Transform a path in the condensation dag into a substream

Parameters
  • path – Sequence of identifiers of StronglyConnectedComponent objects in the current CondensationDag

  • node_to_label

  • path_bounds

Returns

plot_fastest_path(path, latency, source, destination, col='#8f246b')[source]

Draw a path on the current CondensationDag

Parameters
  • path

  • latency

  • source

  • destination

  • col

Returns

plot_foremost_path(path, ttr, source, destination, col='#8f246b')[source]

Draw a path on the current CondensationDag

Parameters
  • path – A Stream Graph

  • ttr

  • source

  • destination

  • col

Returns

postprocess_fastest_paths(fastest_paths_comp, latencies_comp)[source]
postprocess_latencies(latencies_comp, source)[source]
postprocess_ttr(source, ttr_comp)[source]
refactor_path(path_comp, path_times, source, destination)[source]
shortest_fastest_path_ss(source, node_to_label=None)[source]

Compute Shortest Fastest Paths in a single source manner in a StreamGraph using the current CondensationDag.

Parameters
  • source

  • node_to_label

Returns

temporal_node_to_scc(node)[source]

Return the StronglyConnectedComponent containing the temporal source node.

Parameters

node

Returns

time_to_reach(source, destination)[source]
times_to_reach_ss(source)[source]
straph.dags.condensation_dag.compute_all_foremost_paths(dict_id_wcc_to_dag, index_node_to_scc, source, destination, duration_threshold=None, start_comp=None)[source]

Compute a foremost path between ‘source’ and ‘destination” starting at ‘begin time’.

Parameters
  • dict_id_wcc_to_dag

  • index_node_to_scc

  • source

  • destination

  • duration_threshold

  • start_comp

Returns

straph.dags.dag module

class straph.dags.dag.Dag(id=None, times=None, c_nodes=None, c_links=None, id_comp_to_comp=None, node_to_id_comp=None, segmented_node_to_id_comp=None, adj_list=None)[source]

Bases: object

add_node(n)[source]
add_nodes(l)[source]
adjacency_list()[source]
describe()[source]

Print a Short description of the current Dag object.

Returns

Nothing

plot(colors=None, title=None, node_to_label=None, fontsize=26, ax=None)[source]
plot_as_nx(label=True)[source]
plot_custom(label=True, arrow=True, fontsize=30, path=None)[source]
refactor()[source]
set_id(id)[source]
set_id_comp_to_comp()[source]
set_index_id_comp_to_comp(index)[source]
set_index_node_to_id_comp()[source]
set_index_segmented_node_to_id_comp(segmented_nodes)[source]
size()[source]
straph.dags.dag.add_arrow(e, ax, direction='right', size=25, color=None, alpha=0.5)[source]

Thanks to : https://stackoverflow.com/questions/34017866/arrow-on-a-line-plot-with-matplotlib add an arrow to a line.

Parameters
  • e – ((a_x,_y),(b_x,b_y))

  • ax – matplotlib axes

  • direction – ‘left’ or ‘right’

  • size – size of the arrow in fontsize points

  • color – color of arrow (should be coherent with line color, or not )

  • alpha

Returns

straph.dags.dag.merge_dags(dag_list)[source]

Merge every other streams into the first one, we assume there’s no connection between them and that links aren’t constructed yet

Parameters

dag_list – A list of Dag objects

Returns

straph.dags.stable_dag module

class straph.dags.stable_dag.StableDag(id=None, times=None, c_nodes=None, c_links=None, id_comp_to_comp=None, node_to_id_comp=None, segmented_node_to_id_comp=None, adj_list=None)[source]

Bases: straph.dags.dag.Dag

all_cliques(n_jobs=- 1)[source]
cluster_to_object()[source]
core_number(n_jobs=- 1)[source]
k_clique(k, n_jobs=- 1)[source]
k_core(k, n_jobs=- 1)[source]

Module contents