│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Computation times

│ │ │ │ -

00:27.182 total execution time for tutorials files:

│ │ │ │ +

00:29.540 total execution time for tutorials files:

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

Cliques (visualize_cliques.py)

00:09.635

00:09.679

0.0 MB

Ring Graph Animation (ring_animation.py)

00:02.783

00:03.728

0.0 MB

Betweenness (betweenness.py)

00:02.337

Generating Cluster Graphs (cluster_contraction.py)

00:02.885

0.0 MB

Visual styling (visual_style.py)

00:02.171

Betweenness (betweenness.py)

00:02.270

0.0 MB

Generating Cluster Graphs (cluster_contraction.py)

00:01.680

Visual styling (visual_style.py)

00:02.175

0.0 MB

Configuration Instance (configuration.py)

00:01.258

00:01.250

0.0 MB

Erdős-Rényi Graph (erdos_renyi.py)

00:00.958

00:00.955

0.0 MB

Delaunay Triangulation (delaunay-triangulation.py)

00:00.713

00:00.708

0.0 MB

Connected Components (connected_components.py)

00:00.642

Online user actions (online_user_actions.py)

00:00.696

0.0 MB

Complement (complement.py)

00:00.603

Connected Components (connected_components.py)

00:00.639

0.0 MB

Online user actions (online_user_actions.py)

00:00.592

Complement (complement.py)

00:00.600

0.0 MB

Communities (visualize_communities.py)

00:00.514

00:00.511

0.0 MB

Spanning Trees (spanning_trees.py)

00:00.485

00:00.477

0.0 MB

Bridges (bridges.py)

00:00.460

00:00.453

0.0 MB

Minimum Spanning Trees (minimum_spanning_trees.py)

00:00.402

Quick Start (quickstart.py)

00:00.446

0.0 MB

Isomorphism (isomorphism.py)

00:00.327

Minimum Spanning Trees (minimum_spanning_trees.py)

00:00.399

0.0 MB

Directed Acyclic Graph (generate_dag.py)

00:00.278

Isomorphism (isomorphism.py)

00:00.322

0.0 MB

Quick Start (quickstart.py)

00:00.272

Directed Acyclic Graph (generate_dag.py)

00:00.277

0.0 MB

Simplify (simplify.py)

00:00.197

00:00.198

0.0 MB

Maximum Bipartite Matching by Maximum Flow (bipartite_matching_maxflow.py)

00:00.187

0.0 MB

Articulation Points (articulation_points.py)

00:00.158

0.0 MB

Maximum Bipartite Matching (bipartite_matching.py)

00:00.152

00:00.153

0.0 MB

Topological sorting (topological_sort.py)

00:00.133

00:00.131

0.0 MB

Shortest Paths (shortest_path_visualisation.py)

00:00.128

0.0 MB

Maximum Flow (maxflow.py)

00:00.117

00:00.116

0.0 MB

│ │ │ │
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -12,37 +12,37 @@ │ │ │ │ │ * _C_o_n_f_i_g_u_r_a_t_i_o_n │ │ │ │ │ * _F_r_e_q_u_e_n_t_l_y_ _a_s_k_e_d_ _q_u_e_s_t_i_o_n_s │ │ │ │ │ _i_g_r_a_p_h │ │ │ │ │ * Computation times │ │ │ │ │ * _V_i_e_w_ _p_a_g_e_ _s_o_u_r_c_e │ │ │ │ │ =============================================================================== │ │ │ │ │ ************ CCoommppuuttaattiioonn ttiimmeess_? ************ │ │ │ │ │ -0000::2277..118822 total execution time for ttuuttoorriiaallss files: │ │ │ │ │ -_C_l_i_q_u_e_s (visualize_cliques.py) 00:09.635 0.0 MB │ │ │ │ │ -_R_i_n_g_ _G_r_a_p_h_ _A_n_i_m_a_t_i_o_n (ring_animation.py) 00:02.783 0.0 MB │ │ │ │ │ -_B_e_t_w_e_e_n_n_e_s_s (betweenness.py) 00:02.337 0.0 MB │ │ │ │ │ -_V_i_s_u_a_l_ _s_t_y_l_i_n_g (visual_style.py) 00:02.171 0.0 MB │ │ │ │ │ -_G_e_n_e_r_a_t_i_n_g_ _C_l_u_s_t_e_r_ _G_r_a_p_h_s (cluster_contraction.py) 00:01.680 0.0 MB │ │ │ │ │ -_C_o_n_f_i_g_u_r_a_t_i_o_n_ _I_n_s_t_a_n_c_e (configuration.py) 00:01.258 0.0 MB │ │ │ │ │ -_E_r_d_ő_s_-_R_é_n_y_i_ _G_r_a_p_h (erdos_renyi.py) 00:00.958 0.0 MB │ │ │ │ │ -_D_e_l_a_u_n_a_y_ _T_r_i_a_n_g_u_l_a_t_i_o_n (delaunay-triangulation.py) 00:00.713 0.0 MB │ │ │ │ │ -_C_o_n_n_e_c_t_e_d_ _C_o_m_p_o_n_e_n_t_s (connected_components.py) 00:00.642 0.0 MB │ │ │ │ │ -_C_o_m_p_l_e_m_e_n_t (complement.py) 00:00.603 0.0 MB │ │ │ │ │ -_O_n_l_i_n_e_ _u_s_e_r_ _a_c_t_i_o_n_s (online_user_actions.py) 00:00.592 0.0 MB │ │ │ │ │ -_C_o_m_m_u_n_i_t_i_e_s (visualize_communities.py) 00:00.514 0.0 MB │ │ │ │ │ -_S_p_a_n_n_i_n_g_ _T_r_e_e_s (spanning_trees.py) 00:00.485 0.0 MB │ │ │ │ │ -_B_r_i_d_g_e_s (bridges.py) 00:00.460 0.0 MB │ │ │ │ │ -_M_i_n_i_m_u_m_ _S_p_a_n_n_i_n_g_ _T_r_e_e_s (minimum_spanning_trees.py) 00:00.402 0.0 MB │ │ │ │ │ -_I_s_o_m_o_r_p_h_i_s_m (isomorphism.py) 00:00.327 0.0 MB │ │ │ │ │ -_D_i_r_e_c_t_e_d_ _A_c_y_c_l_i_c_ _G_r_a_p_h (generate_dag.py) 00:00.278 0.0 MB │ │ │ │ │ -_Q_u_i_c_k_ _S_t_a_r_t (quickstart.py) 00:00.272 0.0 MB │ │ │ │ │ -_S_i_m_p_l_i_f_y (simplify.py) 00:00.197 0.0 MB │ │ │ │ │ +0000::2299..554400 total execution time for ttuuttoorriiaallss files: │ │ │ │ │ +_C_l_i_q_u_e_s (visualize_cliques.py) 00:09.679 0.0 MB │ │ │ │ │ +_R_i_n_g_ _G_r_a_p_h_ _A_n_i_m_a_t_i_o_n (ring_animation.py) 00:03.728 0.0 MB │ │ │ │ │ +_G_e_n_e_r_a_t_i_n_g_ _C_l_u_s_t_e_r_ _G_r_a_p_h_s (cluster_contraction.py) 00:02.885 0.0 MB │ │ │ │ │ +_B_e_t_w_e_e_n_n_e_s_s (betweenness.py) 00:02.270 0.0 MB │ │ │ │ │ +_V_i_s_u_a_l_ _s_t_y_l_i_n_g (visual_style.py) 00:02.175 0.0 MB │ │ │ │ │ +_C_o_n_f_i_g_u_r_a_t_i_o_n_ _I_n_s_t_a_n_c_e (configuration.py) 00:01.250 0.0 MB │ │ │ │ │ +_E_r_d_ő_s_-_R_é_n_y_i_ _G_r_a_p_h (erdos_renyi.py) 00:00.955 0.0 MB │ │ │ │ │ +_D_e_l_a_u_n_a_y_ _T_r_i_a_n_g_u_l_a_t_i_o_n (delaunay-triangulation.py) 00:00.708 0.0 MB │ │ │ │ │ +_O_n_l_i_n_e_ _u_s_e_r_ _a_c_t_i_o_n_s (online_user_actions.py) 00:00.696 0.0 MB │ │ │ │ │ +_C_o_n_n_e_c_t_e_d_ _C_o_m_p_o_n_e_n_t_s (connected_components.py) 00:00.639 0.0 MB │ │ │ │ │ +_C_o_m_p_l_e_m_e_n_t (complement.py) 00:00.600 0.0 MB │ │ │ │ │ +_C_o_m_m_u_n_i_t_i_e_s (visualize_communities.py) 00:00.511 0.0 MB │ │ │ │ │ +_S_p_a_n_n_i_n_g_ _T_r_e_e_s (spanning_trees.py) 00:00.477 0.0 MB │ │ │ │ │ +_B_r_i_d_g_e_s (bridges.py) 00:00.453 0.0 MB │ │ │ │ │ +_Q_u_i_c_k_ _S_t_a_r_t (quickstart.py) 00:00.446 0.0 MB │ │ │ │ │ +_M_i_n_i_m_u_m_ _S_p_a_n_n_i_n_g_ _T_r_e_e_s (minimum_spanning_trees.py) 00:00.399 0.0 MB │ │ │ │ │ +_I_s_o_m_o_r_p_h_i_s_m (isomorphism.py) 00:00.322 0.0 MB │ │ │ │ │ +_D_i_r_e_c_t_e_d_ _A_c_y_c_l_i_c_ _G_r_a_p_h (generate_dag.py) 00:00.277 0.0 MB │ │ │ │ │ +_S_i_m_p_l_i_f_y (simplify.py) 00:00.198 0.0 MB │ │ │ │ │ _M_a_x_i_m_u_m_ _B_i_p_a_r_t_i_t_e_ _M_a_t_c_h_i_n_g_ _b_y_ _M_a_x_i_m_u_m_ _F_l_o_w 00:00.187 0.0 MB │ │ │ │ │ (bipartite_matching_maxflow.py) │ │ │ │ │ _A_r_t_i_c_u_l_a_t_i_o_n_ _P_o_i_n_t_s (articulation_points.py) 00:00.158 0.0 MB │ │ │ │ │ -_M_a_x_i_m_u_m_ _B_i_p_a_r_t_i_t_e_ _M_a_t_c_h_i_n_g (bipartite_matching.py) 00:00.152 0.0 MB │ │ │ │ │ -_T_o_p_o_l_o_g_i_c_a_l_ _s_o_r_t_i_n_g (topological_sort.py) 00:00.133 0.0 MB │ │ │ │ │ +_M_a_x_i_m_u_m_ _B_i_p_a_r_t_i_t_e_ _M_a_t_c_h_i_n_g (bipartite_matching.py) 00:00.153 0.0 MB │ │ │ │ │ +_T_o_p_o_l_o_g_i_c_a_l_ _s_o_r_t_i_n_g (topological_sort.py) 00:00.131 0.0 MB │ │ │ │ │ _S_h_o_r_t_e_s_t_ _P_a_t_h_s (shortest_path_visualisation.py) 00:00.128 0.0 MB │ │ │ │ │ -_M_a_x_i_m_u_m_ _F_l_o_w (maxflow.py) 00:00.117 0.0 MB │ │ │ │ │ +_M_a_x_i_m_u_m_ _F_l_o_w (maxflow.py) 00:00.116 0.0 MB │ │ │ │ │ =============================================================================== │ │ │ │ │ © Copyright 2010-2024, The igraph development team. │ │ │ │ │ Built with _S_p_h_i_n_x using a _t_h_e_m_e provided by _R_e_a_d_ _t_h_e_ _D_o_c_s. │ │ │ ├── ./usr/share/doc/python-igraph-doc/html/tutorials/simplify.html │ │ │ │ @@ -150,15 +150,15 @@ │ │ │ │ copy of our graph, and then simplify that copy to keep the original graph │ │ │ │ untouched:

│ │ │ │
g2 = g1.copy()
│ │ │ │  g2.simplify()
│ │ │ │  
│ │ │ │
│ │ │ │

Out:

│ │ │ │ -
<igraph.Graph object at 0xffff88913650>
│ │ │ │ +
<igraph.Graph object at 0xffff901d3a50>
│ │ │ │  
│ │ │ │
│ │ │ │

We can then proceed to plot both graphs to see the difference. First, let’s │ │ │ │ choose a consistent visual style:

│ │ │ │
visual_style = {
│ │ │ │      "vertex_color": "lightblue",
│ │ │ │      "vertex_size": 20,
│ │ │ │ @@ -189,15 +189,15 @@
│ │ │ │      ))
│ │ │ │  axs[1].add_patch(plt.Rectangle(
│ │ │ │      (0, 0), 1, 1, fc='none', ec='k', lw=4, transform=axs[1].transAxes,
│ │ │ │      ))
│ │ │ │  plt.show()
│ │ │ │  
│ │ │ │
│ │ │ │ -Multigraph..., ...simplified

Total running time of the script: ( 0 minutes 0.197 seconds)

│ │ │ │ +Multigraph..., ...simplified

Total running time of the script: ( 0 minutes 0.198 seconds)

│ │ │ │
│ │ │ │
│ │ │ │ spanning trees
│ │ │ │

Note

│ │ │ │

To invert the y axis such that the root of the tree is on top of the plot, │ │ │ │ you can call ax.invert_yaxis() before plt.show().

│ │ │ │
│ │ │ │ -

Total running time of the script: ( 0 minutes 0.485 seconds)

│ │ │ │ +

Total running time of the script: ( 0 minutes 0.477 seconds)

│ │ │ │ │ │ │ │
│ │ │ │ -

Total running time of the script: ( 0 minutes 0.133 seconds)

│ │ │ │ +

Total running time of the script: ( 0 minutes 0.131 seconds)

│ │ │ │ │ │ │ │