okstra 0.108.0 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.kr.md +1 -1
- package/README.md +1 -1
- package/docs/kr/architecture.md +3 -3
- package/docs/kr/cli.md +2 -2
- package/docs/project-structure-overview.md +3 -3
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/prompts/profiles/_common-contract.md +1 -1
- package/runtime/python/okstra_ctl/graphify_cmd.py +225 -0
- package/runtime/python/okstra_ctl/resolve_task_key.py +15 -9
- package/runtime/python/okstra_ctl/worktree.py +14 -13
- package/runtime/python/okstra_project/__init__.py +2 -0
- package/runtime/python/okstra_project/state.py +36 -0
- package/runtime/python/okstra_vendor/__init__.py +41 -0
- package/runtime/python/okstra_vendor/graphify/.vendored-version +1 -0
- package/runtime/python/okstra_vendor/graphify/__init__.py +28 -0
- package/runtime/python/okstra_vendor/graphify/__main__.py +1371 -0
- package/runtime/python/okstra_vendor/graphify/analyze.py +540 -0
- package/runtime/python/okstra_vendor/graphify/benchmark.py +129 -0
- package/runtime/python/okstra_vendor/graphify/build.py +107 -0
- package/runtime/python/okstra_vendor/graphify/cache.py +169 -0
- package/runtime/python/okstra_vendor/graphify/cluster.py +137 -0
- package/runtime/python/okstra_vendor/graphify/detect.py +510 -0
- package/runtime/python/okstra_vendor/graphify/export.py +1014 -0
- package/runtime/python/okstra_vendor/graphify/extract.py +3277 -0
- package/runtime/python/okstra_vendor/graphify/hooks.py +220 -0
- package/runtime/python/okstra_vendor/graphify/ingest.py +297 -0
- package/runtime/python/okstra_vendor/graphify/manifest.py +4 -0
- package/runtime/python/okstra_vendor/graphify/report.py +175 -0
- package/runtime/python/okstra_vendor/graphify/security.py +203 -0
- package/runtime/python/okstra_vendor/graphify/serve.py +373 -0
- package/runtime/python/okstra_vendor/graphify/skill-aider.md +1184 -0
- package/runtime/python/okstra_vendor/graphify/skill-claw.md +1184 -0
- package/runtime/python/okstra_vendor/graphify/skill-codex.md +1242 -0
- package/runtime/python/okstra_vendor/graphify/skill-copilot.md +1268 -0
- package/runtime/python/okstra_vendor/graphify/skill-droid.md +1239 -0
- package/runtime/python/okstra_vendor/graphify/skill-kiro.md +1183 -0
- package/runtime/python/okstra_vendor/graphify/skill-opencode.md +1238 -0
- package/runtime/python/okstra_vendor/graphify/skill-trae.md +1208 -0
- package/runtime/python/okstra_vendor/graphify/skill-vscode.md +253 -0
- package/runtime/python/okstra_vendor/graphify/skill-windows.md +1245 -0
- package/runtime/python/okstra_vendor/graphify/skill.md +1319 -0
- package/runtime/python/okstra_vendor/graphify/transcribe.py +182 -0
- package/runtime/python/okstra_vendor/graphify/validate.py +72 -0
- package/runtime/python/okstra_vendor/graphify/watch.py +188 -0
- package/runtime/python/okstra_vendor/graphify/wiki.py +214 -0
- package/runtime/python/okstra_vendor/networkx/__init__.py +62 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/__init__.py +134 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/__init__.py +26 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/clique.py +259 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/clustering_coefficient.py +71 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/connectivity.py +412 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/density.py +396 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/distance_measures.py +150 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/dominating_set.py +149 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/kcomponents.py +369 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/matching.py +44 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/maxcut.py +143 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/ramsey.py +53 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/steinertree.py +265 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_approx_clust_coeff.py +41 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_clique.py +112 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_connectivity.py +199 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_density.py +146 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_distance_measures.py +59 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_dominating_set.py +78 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_kcomponents.py +303 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_matching.py +8 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_maxcut.py +94 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_ramsey.py +31 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_steinertree.py +306 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_traveling_salesman.py +1014 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_treewidth.py +274 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/tests/test_vertex_cover.py +68 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/traveling_salesman.py +1508 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/treewidth.py +255 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/approximation/vertex_cover.py +83 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/__init__.py +5 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/connectivity.py +122 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/correlation.py +302 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/mixing.py +255 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/neighbor_degree.py +160 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/pairs.py +127 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/base_test.py +81 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_connectivity.py +143 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_correlation.py +122 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_mixing.py +174 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_neighbor_degree.py +107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/assortativity/tests/test_pairs.py +87 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/asteroidal.py +164 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/__init__.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/basic.py +322 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/centrality.py +290 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/cluster.py +289 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/covering.py +57 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/edgelist.py +360 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/extendability.py +105 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/generators.py +603 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/link_analysis.py +316 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/matching.py +590 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/matrix.py +232 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/projection.py +526 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/redundancy.py +112 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/spectral.py +69 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_basic.py +125 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_centrality.py +192 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_cluster.py +84 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_covering.py +33 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_edgelist.py +240 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_extendability.py +334 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_generators.py +407 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_link_analysis.py +218 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matching.py +327 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_matrix.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_project.py +409 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_redundancy.py +35 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bipartite/tests/test_spectral_bipartivity.py +80 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/boundary.py +168 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/bridges.py +205 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/broadcasting.py +164 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/__init__.py +20 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/betweenness.py +591 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/betweenness_subset.py +236 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/closeness.py +282 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_betweenness.py +364 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_betweenness_subset.py +227 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/current_flow_closeness.py +96 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/degree_alg.py +150 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/dispersion.py +107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/eigenvector.py +357 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/flow_matrix.py +130 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/group.py +787 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/harmonic.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/katz.py +331 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/laplacian.py +150 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/load.py +200 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/percolation.py +128 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/reaching.py +209 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/second_order.py +141 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/subgraph_alg.py +361 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality.py +923 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_betweenness_centrality_subset.py +354 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_closeness_centrality.py +274 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality.py +259 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py +147 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_current_flow_closeness.py +43 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_degree_centrality.py +144 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_dispersion.py +73 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_eigenvector_centrality.py +186 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_group.py +277 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_harmonic_centrality.py +122 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_katz_centrality.py +345 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_laplacian_centrality.py +220 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_load_centrality.py +344 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_percolation_centrality.py +87 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_reaching.py +140 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_second_order_centrality.py +82 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_subgraph.py +110 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_trophic.py +302 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/tests/test_voterank.py +64 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/trophic.py +181 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/centrality/voterank_alg.py +95 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/chains.py +172 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/chordal.py +443 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/clique.py +818 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/cluster.py +732 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/__init__.py +4 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/equitable_coloring.py +505 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/greedy_coloring.py +565 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/coloring/tests/test_coloring.py +863 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/communicability_alg.py +163 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/__init__.py +28 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/asyn_fluid.py +153 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/bipartitions.py +354 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/centrality.py +171 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/community_utils.py +30 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/divisive.py +216 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/kclique.py +79 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/label_propagation.py +338 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/leiden.py +162 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/local.py +220 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/louvain.py +384 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/lukes.py +227 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/modularity_max.py +452 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/quality.py +347 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_asyn_fluid.py +147 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_bipartitions.py +157 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_centrality.py +85 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_divisive.py +106 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_kclique.py +91 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_label_propagation.py +241 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_leiden.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_local.py +76 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_louvain.py +264 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_lukes.py +152 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_modularity_max.py +340 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_quality.py +139 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/community/tests/test_utils.py +26 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/__init__.py +6 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/attracting.py +115 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/biconnected.py +394 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/connected.py +282 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/semiconnected.py +71 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/strongly_connected.py +359 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_attracting.py +70 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_biconnected.py +248 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_connected.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_semiconnected.py +55 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_strongly_connected.py +193 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/tests/test_weakly_connected.py +96 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/components/weakly_connected.py +196 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/__init__.py +11 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/connectivity.py +811 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/cuts.py +616 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/disjoint_paths.py +408 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/edge_augmentation.py +1270 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/edge_kcomponents.py +592 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/kcomponents.py +220 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/kcutsets.py +235 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/stoerwagner.py +152 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_connectivity.py +421 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_cuts.py +309 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_disjoint_paths.py +249 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_augmentation.py +502 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_edge_kcomponents.py +488 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcomponents.py +323 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_kcutsets.py +280 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/tests/test_stoer_wagner.py +102 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/connectivity/utils.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/core.py +588 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/covering.py +142 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/cuts.py +416 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/cycles.py +1234 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/d_separation.py +677 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/dag.py +1392 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/distance_measures.py +1095 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/distance_regular.py +272 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/dominance.py +142 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/dominating.py +268 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/efficiency_measures.py +167 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/euler.py +470 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/__init__.py +11 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/boykovkolmogorov.py +370 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/capacityscaling.py +407 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/dinitz_alg.py +238 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/edmondskarp.py +241 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/gomory_hu.py +178 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/maxflow.py +611 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/mincost.py +356 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/networksimplex.py +662 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/preflowpush.py +425 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/shortestaugmentingpath.py +300 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gl1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/gw1.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/netgen-2.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_gomory_hu.py +128 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow.py +573 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_maxflow_large_graph.py +155 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_mincost.py +475 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/test_networksimplex.py +481 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/tests/wlm3.gpickle.bz2 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/flow/utils.py +194 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/graph_hashing.py +435 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/graphical.py +483 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/hierarchy.py +57 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/hybrid.py +196 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isolate.py +107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/__init__.py +7 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/ismags.py +1306 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/isomorph.py +336 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/isomorphvf2.py +1262 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/matchhelpers.py +352 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/temporalisomorphvf2.py +308 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/iso_r01_s80.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.A99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/si2_b06_m200.B99 +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_ismags.py +719 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphism.py +103 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py +490 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_match_helpers.py +64 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py +212 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_tree_isomorphism.py +202 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp.py +1655 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2pp_helpers.py +3118 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_vf2userfunc.py +196 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tree_isomorphism.py +264 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/vf2pp.py +1102 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/vf2userfunc.py +192 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/__init__.py +2 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/hits_alg.py +337 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/pagerank_alg.py +498 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_hits.py +77 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_analysis/tests/test_pagerank.py +213 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/link_prediction.py +687 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/lowest_common_ancestors.py +280 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/matching.py +1148 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/__init__.py +27 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/contraction.py +738 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/minors/tests/test_contraction.py +544 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/mis.py +78 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/moral.py +59 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/node_classification.py +219 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/non_randomness.py +155 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/__init__.py +4 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/all.py +324 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/binary.py +468 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/product.py +633 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_all.py +328 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_binary.py +451 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_product.py +491 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/tests/test_unary.py +55 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/operators/unary.py +77 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/perfect_graph.py +73 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/planar_drawing.py +464 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/planarity.py +1463 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/polynomials.py +306 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/reciprocity.py +98 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/regular.py +167 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/richclub.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/__init__.py +5 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/astar.py +239 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/dense.py +264 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/generic.py +716 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_astar.py +254 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense.py +212 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_dense_numpy.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_generic.py +511 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_unweighted.py +149 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/tests/test_weighted.py +983 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/unweighted.py +625 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/shortest_paths/weighted.py +2542 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/similarity.py +2107 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/simple_paths.py +966 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/smallworld.py +404 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/smetric.py +30 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/sparsifiers.py +296 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/structuralholes.py +374 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/summarization.py +564 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/swap.py +406 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_asteroidal.py +23 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_boundary.py +154 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_bridges.py +144 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_broadcasting.py +109 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chains.py +136 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_chordal.py +129 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_clique.py +300 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cluster.py +678 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_communicability.py +80 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_core.py +266 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_covering.py +85 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cuts.py +171 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_cycles.py +984 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_d_separation.py +340 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dag.py +835 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_measures.py +831 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_distance_regular.py +85 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominance.py +299 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_dominating.py +115 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_efficiency.py +58 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_euler.py +314 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graph_hashing.py +872 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_graphical.py +163 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hierarchy.py +46 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_hybrid.py +24 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_isolate.py +26 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_link_prediction.py +615 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_lowest_common_ancestors.py +459 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_matching.py +556 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_max_weight_clique.py +179 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_mis.py +62 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_moral.py +15 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_node_classification.py +140 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_non_randomness.py +60 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_perfect_graph.py +27 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planar_drawing.py +274 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_planarity.py +556 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_polynomials.py +57 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_reciprocity.py +37 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_regular.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_richclub.py +149 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_similarity.py +1158 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_simple_paths.py +803 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smallworld.py +76 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_smetric.py +8 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_sparsifiers.py +138 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_structuralholes.py +191 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_summarization.py +642 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_swap.py +179 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_threshold.py +270 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_time_dependent.py +431 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_tournament.py +161 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_triads.py +248 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_vitality.py +41 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_voronoi.py +103 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_walks.py +54 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tests/test_wiener.py +157 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/threshold.py +981 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/time_dependent.py +142 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tournament.py +406 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/__init__.py +5 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/beamsearch.py +90 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/breadth_first_search.py +576 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/depth_first_search.py +529 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/edgebfs.py +185 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/edgedfs.py +182 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_beamsearch.py +25 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_bfs.py +203 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_dfs.py +307 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgebfs.py +147 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/traversal/tests/test_edgedfs.py +131 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/__init__.py +7 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/branchings.py +1042 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/coding.py +413 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/decomposition.py +88 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/distance_measures.py +219 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/mst.py +1281 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/operations.py +106 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/recognition.py +273 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_branchings.py +624 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_coding.py +114 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_decomposition.py +79 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_distance_measures.py +99 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_mst.py +934 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_operations.py +53 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/tree/tests/test_recognition.py +174 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/triads.py +500 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/vitality.py +76 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/voronoi.py +86 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/walks.py +77 -0
- package/runtime/python/okstra_vendor/networkx/algorithms/wiener.py +278 -0
- package/runtime/python/okstra_vendor/networkx/classes/__init__.py +13 -0
- package/runtime/python/okstra_vendor/networkx/classes/coreviews.py +435 -0
- package/runtime/python/okstra_vendor/networkx/classes/digraph.py +1363 -0
- package/runtime/python/okstra_vendor/networkx/classes/filters.py +95 -0
- package/runtime/python/okstra_vendor/networkx/classes/function.py +1549 -0
- package/runtime/python/okstra_vendor/networkx/classes/graph.py +2082 -0
- package/runtime/python/okstra_vendor/networkx/classes/graphviews.py +269 -0
- package/runtime/python/okstra_vendor/networkx/classes/multidigraph.py +977 -0
- package/runtime/python/okstra_vendor/networkx/classes/multigraph.py +1294 -0
- package/runtime/python/okstra_vendor/networkx/classes/reportviews.py +1447 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/dispatch_interface.py +192 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/historical_tests.py +476 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_coreviews.py +362 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph.py +331 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_digraph_historical.py +110 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_filters.py +177 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_function.py +1045 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph.py +950 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graph_historical.py +12 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_graphviews.py +349 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multidigraph.py +459 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_multigraph.py +528 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_reportviews.py +1421 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_special.py +131 -0
- package/runtime/python/okstra_vendor/networkx/classes/tests/test_subgraphviews.py +371 -0
- package/runtime/python/okstra_vendor/networkx/conftest.py +261 -0
- package/runtime/python/okstra_vendor/networkx/convert.py +502 -0
- package/runtime/python/okstra_vendor/networkx/convert_matrix.py +1314 -0
- package/runtime/python/okstra_vendor/networkx/drawing/__init__.py +7 -0
- package/runtime/python/okstra_vendor/networkx/drawing/layout.py +2036 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_agraph.py +470 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_latex.py +570 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_pydot.py +361 -0
- package/runtime/python/okstra_vendor/networkx/drawing/nx_pylab.py +2978 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_complex.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_empty_graph.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_labels_and_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_display_shortest_path.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/baseline/test_house_with_colors.png +0 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_agraph.py +237 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_image_comparison_pylab_mpl.py +229 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_latex.py +285 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_layout.py +631 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pydot.py +146 -0
- package/runtime/python/okstra_vendor/networkx/drawing/tests/test_pylab.py +1582 -0
- package/runtime/python/okstra_vendor/networkx/exception.py +131 -0
- package/runtime/python/okstra_vendor/networkx/generators/__init__.py +34 -0
- package/runtime/python/okstra_vendor/networkx/generators/atlas.dat.gz +0 -0
- package/runtime/python/okstra_vendor/networkx/generators/atlas.py +227 -0
- package/runtime/python/okstra_vendor/networkx/generators/classic.py +1091 -0
- package/runtime/python/okstra_vendor/networkx/generators/cographs.py +68 -0
- package/runtime/python/okstra_vendor/networkx/generators/community.py +1070 -0
- package/runtime/python/okstra_vendor/networkx/generators/degree_seq.py +886 -0
- package/runtime/python/okstra_vendor/networkx/generators/directed.py +572 -0
- package/runtime/python/okstra_vendor/networkx/generators/duplication.py +174 -0
- package/runtime/python/okstra_vendor/networkx/generators/ego.py +66 -0
- package/runtime/python/okstra_vendor/networkx/generators/expanders.py +499 -0
- package/runtime/python/okstra_vendor/networkx/generators/geometric.py +1037 -0
- package/runtime/python/okstra_vendor/networkx/generators/harary_graph.py +163 -0
- package/runtime/python/okstra_vendor/networkx/generators/internet_as_graphs.py +443 -0
- package/runtime/python/okstra_vendor/networkx/generators/intersection.py +125 -0
- package/runtime/python/okstra_vendor/networkx/generators/interval_graph.py +70 -0
- package/runtime/python/okstra_vendor/networkx/generators/joint_degree_seq.py +664 -0
- package/runtime/python/okstra_vendor/networkx/generators/lattice.py +405 -0
- package/runtime/python/okstra_vendor/networkx/generators/line.py +501 -0
- package/runtime/python/okstra_vendor/networkx/generators/mycielski.py +110 -0
- package/runtime/python/okstra_vendor/networkx/generators/nonisomorphic_trees.py +259 -0
- package/runtime/python/okstra_vendor/networkx/generators/random_clustered.py +117 -0
- package/runtime/python/okstra_vendor/networkx/generators/random_graphs.py +1416 -0
- package/runtime/python/okstra_vendor/networkx/generators/small.py +1070 -0
- package/runtime/python/okstra_vendor/networkx/generators/social.py +554 -0
- package/runtime/python/okstra_vendor/networkx/generators/spectral_graph_forge.py +120 -0
- package/runtime/python/okstra_vendor/networkx/generators/stochastic.py +54 -0
- package/runtime/python/okstra_vendor/networkx/generators/sudoku.py +131 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_atlas.py +75 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_classic.py +642 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_cographs.py +20 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_community.py +362 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_degree_seq.py +224 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_directed.py +189 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_duplication.py +103 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_ego.py +39 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_expanders.py +182 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_geometric.py +488 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_harary_graph.py +133 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_internet_as_graphs.py +221 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_intersection.py +28 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_interval_graph.py +144 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_joint_degree_seq.py +125 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_lattice.py +264 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_line.py +316 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_mycielski.py +30 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_nonisomorphic_trees.py +82 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_clustered.py +33 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_random_graphs.py +495 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_small.py +220 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_spectral_graph_forge.py +49 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_stochastic.py +72 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_sudoku.py +92 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_time_series.py +64 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_trees.py +195 -0
- package/runtime/python/okstra_vendor/networkx/generators/tests/test_triads.py +15 -0
- package/runtime/python/okstra_vendor/networkx/generators/time_series.py +74 -0
- package/runtime/python/okstra_vendor/networkx/generators/trees.py +1070 -0
- package/runtime/python/okstra_vendor/networkx/generators/triads.py +94 -0
- package/runtime/python/okstra_vendor/networkx/lazy_imports.py +188 -0
- package/runtime/python/okstra_vendor/networkx/linalg/__init__.py +13 -0
- package/runtime/python/okstra_vendor/networkx/linalg/algebraicconnectivity.py +650 -0
- package/runtime/python/okstra_vendor/networkx/linalg/attrmatrix.py +466 -0
- package/runtime/python/okstra_vendor/networkx/linalg/bethehessianmatrix.py +77 -0
- package/runtime/python/okstra_vendor/networkx/linalg/graphmatrix.py +168 -0
- package/runtime/python/okstra_vendor/networkx/linalg/laplacianmatrix.py +512 -0
- package/runtime/python/okstra_vendor/networkx/linalg/modularitymatrix.py +166 -0
- package/runtime/python/okstra_vendor/networkx/linalg/spectrum.py +186 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_algebraic_connectivity.py +400 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_attrmatrix.py +108 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_bethehessian.py +40 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_graphmatrix.py +275 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_laplacian.py +334 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_modularity.py +86 -0
- package/runtime/python/okstra_vendor/networkx/linalg/tests/test_spectrum.py +70 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/__init__.py +17 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/adjlist.py +330 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/edgelist.py +489 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/gexf.py +1084 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/gml.py +879 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/graph6.py +427 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/graphml.py +1053 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/__init__.py +19 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/adjacency.py +156 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/cytoscape.py +190 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/node_link.py +261 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_adjacency.py +78 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_cytoscape.py +78 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_node_link.py +109 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tests/test_tree.py +48 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/json_graph/tree.py +137 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/leda.py +108 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/multiline_adjlist.py +393 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/p2g.py +113 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/pajek.py +286 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/sparse6.py +379 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_adjlist.py +354 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_edgelist.py +318 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gexf.py +612 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_gml.py +744 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graph6.py +181 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_graphml.py +1531 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_leda.py +30 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_p2g.py +63 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_pajek.py +128 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_sparse6.py +166 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/tests/test_text.py +1742 -0
- package/runtime/python/okstra_vendor/networkx/readwrite/text.py +851 -0
- package/runtime/python/okstra_vendor/networkx/relabel.py +285 -0
- package/runtime/python/okstra_vendor/networkx/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_all_random_functions.py +248 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert.py +321 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_numpy.py +531 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_pandas.py +349 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_convert_scipy.py +281 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_exceptions.py +40 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_import.py +11 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_lazy_imports.py +96 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_relabel.py +349 -0
- package/runtime/python/okstra_vendor/networkx/tests/test_removed_functions_exception_messages.py +8 -0
- package/runtime/python/okstra_vendor/networkx/utils/__init__.py +8 -0
- package/runtime/python/okstra_vendor/networkx/utils/backends.py +2171 -0
- package/runtime/python/okstra_vendor/networkx/utils/configs.py +396 -0
- package/runtime/python/okstra_vendor/networkx/utils/decorators.py +1233 -0
- package/runtime/python/okstra_vendor/networkx/utils/heaps.py +338 -0
- package/runtime/python/okstra_vendor/networkx/utils/mapped_queue.py +297 -0
- package/runtime/python/okstra_vendor/networkx/utils/misc.py +703 -0
- package/runtime/python/okstra_vendor/networkx/utils/random_sequence.py +198 -0
- package/runtime/python/okstra_vendor/networkx/utils/rcm.py +159 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/__init__.py +0 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test__init.py +11 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_backends.py +225 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_config.py +263 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_decorators.py +510 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_heaps.py +131 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_mapped_queue.py +268 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_misc.py +393 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_random_sequence.py +53 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_rcm.py +63 -0
- package/runtime/python/okstra_vendor/networkx/utils/tests/test_unionfind.py +55 -0
- package/runtime/python/okstra_vendor/networkx/utils/union_find.py +106 -0
- package/runtime/skills/okstra-graphify/SKILL.md +161 -0
- package/runtime/skills/okstra-inspect/SKILL.md +17 -9
- package/runtime/templates/reports/settings.template.json +4 -0
- package/src/cli-registry.mjs +7 -0
- package/src/commands/graphify.mjs +32 -0
- package/src/commands/lifecycle/doctor.mjs +9 -0
- package/src/lib/skill-catalog.mjs +1 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Moody and White algorithm for k-components
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from collections import defaultdict
|
|
6
|
+
from itertools import combinations
|
|
7
|
+
from operator import itemgetter
|
|
8
|
+
|
|
9
|
+
import networkx as nx
|
|
10
|
+
|
|
11
|
+
# Define the default maximum flow function.
|
|
12
|
+
from networkx.algorithms.flow import edmonds_karp
|
|
13
|
+
from networkx.utils import not_implemented_for
|
|
14
|
+
|
|
15
|
+
default_flow_func = edmonds_karp
|
|
16
|
+
|
|
17
|
+
__all__ = ["k_components"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@not_implemented_for("directed")
|
|
21
|
+
@nx._dispatchable
|
|
22
|
+
def k_components(G, flow_func=None):
|
|
23
|
+
r"""Returns the k-component structure of a graph G.
|
|
24
|
+
|
|
25
|
+
A `k`-component is a maximal subgraph of a graph G that has, at least,
|
|
26
|
+
node connectivity `k`: we need to remove at least `k` nodes to break it
|
|
27
|
+
into more components. `k`-components have an inherent hierarchical
|
|
28
|
+
structure because they are nested in terms of connectivity: a connected
|
|
29
|
+
graph can contain several 2-components, each of which can contain
|
|
30
|
+
one or more 3-components, and so forth.
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
G : NetworkX graph
|
|
35
|
+
|
|
36
|
+
flow_func : function
|
|
37
|
+
Function to perform the underlying flow computations. Default value
|
|
38
|
+
:meth:`edmonds_karp`. This function performs better in sparse graphs with
|
|
39
|
+
right tailed degree distributions. :meth:`shortest_augmenting_path` will
|
|
40
|
+
perform better in denser graphs.
|
|
41
|
+
|
|
42
|
+
Returns
|
|
43
|
+
-------
|
|
44
|
+
k_components : dict
|
|
45
|
+
Dictionary with all connectivity levels `k` in the input Graph as keys
|
|
46
|
+
and a list of sets of nodes that form a k-component of level `k` as
|
|
47
|
+
values.
|
|
48
|
+
|
|
49
|
+
Raises
|
|
50
|
+
------
|
|
51
|
+
NetworkXNotImplemented
|
|
52
|
+
If the input graph is directed.
|
|
53
|
+
|
|
54
|
+
Examples
|
|
55
|
+
--------
|
|
56
|
+
>>> # Petersen graph has 10 nodes and it is triconnected, thus all
|
|
57
|
+
>>> # nodes are in a single component on all three connectivity levels
|
|
58
|
+
>>> G = nx.petersen_graph()
|
|
59
|
+
>>> k_components = nx.k_components(G)
|
|
60
|
+
|
|
61
|
+
Notes
|
|
62
|
+
-----
|
|
63
|
+
Moody and White [1]_ (appendix A) provide an algorithm for identifying
|
|
64
|
+
k-components in a graph, which is based on Kanevsky's algorithm [2]_
|
|
65
|
+
for finding all minimum-size node cut-sets of a graph (implemented in
|
|
66
|
+
:meth:`all_node_cuts` function):
|
|
67
|
+
|
|
68
|
+
1. Compute node connectivity, k, of the input graph G.
|
|
69
|
+
|
|
70
|
+
2. Identify all k-cutsets at the current level of connectivity using
|
|
71
|
+
Kanevsky's algorithm.
|
|
72
|
+
|
|
73
|
+
3. Generate new graph components based on the removal of
|
|
74
|
+
these cutsets. Nodes in a cutset belong to both sides
|
|
75
|
+
of the induced cut.
|
|
76
|
+
|
|
77
|
+
4. If the graph is neither complete nor trivial, return to 1;
|
|
78
|
+
else end.
|
|
79
|
+
|
|
80
|
+
This implementation also uses some heuristics (see [3]_ for details)
|
|
81
|
+
to speed up the computation.
|
|
82
|
+
|
|
83
|
+
See also
|
|
84
|
+
--------
|
|
85
|
+
node_connectivity
|
|
86
|
+
all_node_cuts
|
|
87
|
+
biconnected_components : special case of this function when k=2
|
|
88
|
+
k_edge_components : similar to this function, but uses edge-connectivity
|
|
89
|
+
instead of node-connectivity
|
|
90
|
+
|
|
91
|
+
References
|
|
92
|
+
----------
|
|
93
|
+
.. [1] Moody, J. and D. White (2003). Social cohesion and embeddedness:
|
|
94
|
+
A hierarchical conception of social groups.
|
|
95
|
+
American Sociological Review 68(1), 103--28.
|
|
96
|
+
http://www2.asanet.org/journals/ASRFeb03MoodyWhite.pdf
|
|
97
|
+
|
|
98
|
+
.. [2] Kanevsky, A. (1993). Finding all minimum-size separating vertex
|
|
99
|
+
sets in a graph. Networks 23(6), 533--541.
|
|
100
|
+
http://onlinelibrary.wiley.com/doi/10.1002/net.3230230604/abstract
|
|
101
|
+
|
|
102
|
+
.. [3] Torrents, J. and F. Ferraro (2015). Structural Cohesion:
|
|
103
|
+
Visualization and Heuristics for Fast Computation.
|
|
104
|
+
https://arxiv.org/pdf/1503.04476v1
|
|
105
|
+
|
|
106
|
+
"""
|
|
107
|
+
# Dictionary with connectivity level (k) as keys and a list of
|
|
108
|
+
# sets of nodes that form a k-component as values. Note that
|
|
109
|
+
# k-components can overlap (but only k - 1 nodes).
|
|
110
|
+
k_components = defaultdict(list)
|
|
111
|
+
# Define default flow function
|
|
112
|
+
if flow_func is None:
|
|
113
|
+
flow_func = default_flow_func
|
|
114
|
+
# Bicomponents as a base to check for higher order k-components
|
|
115
|
+
for component in nx.connected_components(G):
|
|
116
|
+
# isolated nodes have connectivity 0
|
|
117
|
+
comp = set(component)
|
|
118
|
+
if len(comp) > 1:
|
|
119
|
+
k_components[1].append(comp)
|
|
120
|
+
bicomponents = [G.subgraph(c) for c in nx.biconnected_components(G)]
|
|
121
|
+
for bicomponent in bicomponents:
|
|
122
|
+
bicomp = set(bicomponent)
|
|
123
|
+
# avoid considering dyads as bicomponents
|
|
124
|
+
if len(bicomp) > 2:
|
|
125
|
+
k_components[2].append(bicomp)
|
|
126
|
+
for B in bicomponents:
|
|
127
|
+
if len(B) <= 2:
|
|
128
|
+
continue
|
|
129
|
+
k = nx.node_connectivity(B, flow_func=flow_func)
|
|
130
|
+
if k > 2:
|
|
131
|
+
k_components[k].append(set(B))
|
|
132
|
+
# Perform cuts in a DFS like order.
|
|
133
|
+
cuts = list(nx.all_node_cuts(B, k=k, flow_func=flow_func))
|
|
134
|
+
stack = [(k, _generate_partition(B, cuts, k))]
|
|
135
|
+
while stack:
|
|
136
|
+
(parent_k, partition) = stack[-1]
|
|
137
|
+
try:
|
|
138
|
+
nodes = next(partition)
|
|
139
|
+
C = B.subgraph(nodes)
|
|
140
|
+
this_k = nx.node_connectivity(C, flow_func=flow_func)
|
|
141
|
+
if this_k > parent_k and this_k > 2:
|
|
142
|
+
k_components[this_k].append(set(C))
|
|
143
|
+
cuts = list(nx.all_node_cuts(C, k=this_k, flow_func=flow_func))
|
|
144
|
+
if cuts:
|
|
145
|
+
stack.append((this_k, _generate_partition(C, cuts, this_k)))
|
|
146
|
+
except StopIteration:
|
|
147
|
+
stack.pop()
|
|
148
|
+
|
|
149
|
+
# This is necessary because k-components may only be reported at their
|
|
150
|
+
# maximum k level. But we want to return a dictionary in which keys are
|
|
151
|
+
# connectivity levels and values list of sets of components, without
|
|
152
|
+
# skipping any connectivity level. Also, it's possible that subsets of
|
|
153
|
+
# an already detected k-component appear at a level k. Checking for this
|
|
154
|
+
# in the while loop above penalizes the common case. Thus we also have to
|
|
155
|
+
# _consolidate all connectivity levels in _reconstruct_k_components.
|
|
156
|
+
return _reconstruct_k_components(k_components)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _consolidate(sets, k):
|
|
160
|
+
"""Merge sets that share k or more elements.
|
|
161
|
+
|
|
162
|
+
See: http://rosettacode.org/wiki/Set_consolidation
|
|
163
|
+
|
|
164
|
+
The iterative python implementation posted there is
|
|
165
|
+
faster than this because of the overhead of building a
|
|
166
|
+
Graph and calling nx.connected_components, but it's not
|
|
167
|
+
clear for us if we can use it in NetworkX because there
|
|
168
|
+
is no licence for the code.
|
|
169
|
+
|
|
170
|
+
"""
|
|
171
|
+
G = nx.Graph()
|
|
172
|
+
nodes = dict(enumerate(sets))
|
|
173
|
+
G.add_nodes_from(nodes)
|
|
174
|
+
G.add_edges_from(
|
|
175
|
+
(u, v) for u, v in combinations(nodes, 2) if len(nodes[u] & nodes[v]) >= k
|
|
176
|
+
)
|
|
177
|
+
for component in nx.connected_components(G):
|
|
178
|
+
yield set.union(*[nodes[n] for n in component])
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def _generate_partition(G, cuts, k):
|
|
182
|
+
def has_nbrs_in_partition(G, node, partition):
|
|
183
|
+
return any(n in partition for n in G[node])
|
|
184
|
+
|
|
185
|
+
components = []
|
|
186
|
+
n_in_cuts = {n for cut in cuts for n in cut}
|
|
187
|
+
nodes = {n for n, d in G.degree() if d > k} - n_in_cuts
|
|
188
|
+
H = G.subgraph(nodes)
|
|
189
|
+
for cc in map(set, nx.connected_components(H)):
|
|
190
|
+
component = cc | {n for n in n_in_cuts if has_nbrs_in_partition(G, n, cc)}
|
|
191
|
+
if len(component) < G.order():
|
|
192
|
+
components.append(component)
|
|
193
|
+
yield from _consolidate(components, k + 1)
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
def _reconstruct_k_components(k_comps):
|
|
197
|
+
result = {}
|
|
198
|
+
max_k = max(k_comps) if k_comps else 0
|
|
199
|
+
for k in range(max_k, 0, -1):
|
|
200
|
+
if k == max_k:
|
|
201
|
+
result[k] = list(_consolidate(k_comps[k], k))
|
|
202
|
+
elif k not in k_comps:
|
|
203
|
+
result[k] = list(_consolidate(result[k + 1], k))
|
|
204
|
+
else:
|
|
205
|
+
nodes_at_k = set.union(*k_comps[k])
|
|
206
|
+
to_add = [c for c in result[k + 1] if any(n not in nodes_at_k for n in c)]
|
|
207
|
+
if to_add:
|
|
208
|
+
result[k] = list(_consolidate(k_comps[k] + to_add, k))
|
|
209
|
+
else:
|
|
210
|
+
result[k] = list(_consolidate(k_comps[k], k))
|
|
211
|
+
return result
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def build_k_number_dict(kcomps):
|
|
215
|
+
return {
|
|
216
|
+
node: k
|
|
217
|
+
for k, comps in sorted(kcomps.items(), key=itemgetter(0))
|
|
218
|
+
for comp in comps
|
|
219
|
+
for node in comp
|
|
220
|
+
}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Kanevsky all minimum node k cutsets algorithm.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import copy
|
|
6
|
+
from collections import defaultdict
|
|
7
|
+
from itertools import combinations
|
|
8
|
+
from operator import itemgetter
|
|
9
|
+
|
|
10
|
+
import networkx as nx
|
|
11
|
+
from networkx.algorithms.flow import (
|
|
12
|
+
build_residual_network,
|
|
13
|
+
edmonds_karp,
|
|
14
|
+
shortest_augmenting_path,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
from .utils import build_auxiliary_node_connectivity
|
|
18
|
+
|
|
19
|
+
default_flow_func = edmonds_karp
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
__all__ = ["all_node_cuts"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@nx._dispatchable
|
|
26
|
+
def all_node_cuts(G, k=None, flow_func=None):
|
|
27
|
+
r"""Returns all minimum k cutsets of an undirected graph G.
|
|
28
|
+
|
|
29
|
+
This implementation is based on Kanevsky's algorithm [1]_ for finding all
|
|
30
|
+
minimum-size node cut-sets of an undirected graph G; ie the set (or sets)
|
|
31
|
+
of nodes of cardinality equal to the node connectivity of G. Thus if
|
|
32
|
+
removed, would break G into two or more connected components.
|
|
33
|
+
|
|
34
|
+
Parameters
|
|
35
|
+
----------
|
|
36
|
+
G : NetworkX graph
|
|
37
|
+
Undirected graph
|
|
38
|
+
|
|
39
|
+
k : Integer
|
|
40
|
+
Node connectivity of the input graph. If k is None, then it is
|
|
41
|
+
computed. Default value: None.
|
|
42
|
+
|
|
43
|
+
flow_func : function
|
|
44
|
+
Function to perform the underlying flow computations. Default value is
|
|
45
|
+
:func:`~networkx.algorithms.flow.edmonds_karp`. This function performs
|
|
46
|
+
better in sparse graphs with right tailed degree distributions.
|
|
47
|
+
:func:`~networkx.algorithms.flow.shortest_augmenting_path` will
|
|
48
|
+
perform better in denser graphs.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
cuts : a generator of node cutsets
|
|
54
|
+
Each node cutset has cardinality equal to the node connectivity of
|
|
55
|
+
the input graph.
|
|
56
|
+
|
|
57
|
+
Examples
|
|
58
|
+
--------
|
|
59
|
+
>>> # A two-dimensional grid graph has 4 cutsets of cardinality 2
|
|
60
|
+
>>> G = nx.grid_2d_graph(5, 5)
|
|
61
|
+
>>> cutsets = list(nx.all_node_cuts(G))
|
|
62
|
+
>>> len(cutsets)
|
|
63
|
+
4
|
|
64
|
+
>>> all(2 == len(cutset) for cutset in cutsets)
|
|
65
|
+
True
|
|
66
|
+
>>> nx.node_connectivity(G)
|
|
67
|
+
2
|
|
68
|
+
|
|
69
|
+
Notes
|
|
70
|
+
-----
|
|
71
|
+
This implementation is based on the sequential algorithm for finding all
|
|
72
|
+
minimum-size separating vertex sets in a graph [1]_. The main idea is to
|
|
73
|
+
compute minimum cuts using local maximum flow computations among a set
|
|
74
|
+
of nodes of highest degree and all other non-adjacent nodes in the Graph.
|
|
75
|
+
Once we find a minimum cut, we add an edge between the high degree
|
|
76
|
+
node and the target node of the local maximum flow computation to make
|
|
77
|
+
sure that we will not find that minimum cut again.
|
|
78
|
+
|
|
79
|
+
See also
|
|
80
|
+
--------
|
|
81
|
+
node_connectivity
|
|
82
|
+
edmonds_karp
|
|
83
|
+
shortest_augmenting_path
|
|
84
|
+
|
|
85
|
+
References
|
|
86
|
+
----------
|
|
87
|
+
.. [1] Kanevsky, A. (1993). Finding all minimum-size separating vertex
|
|
88
|
+
sets in a graph. Networks 23(6), 533--541.
|
|
89
|
+
http://onlinelibrary.wiley.com/doi/10.1002/net.3230230604/abstract
|
|
90
|
+
|
|
91
|
+
"""
|
|
92
|
+
if not nx.is_connected(G):
|
|
93
|
+
raise nx.NetworkXError("Input graph is disconnected.")
|
|
94
|
+
|
|
95
|
+
# Address some corner cases first.
|
|
96
|
+
# For complete Graphs
|
|
97
|
+
|
|
98
|
+
if nx.density(G) == 1:
|
|
99
|
+
yield from ()
|
|
100
|
+
return
|
|
101
|
+
|
|
102
|
+
# Initialize data structures.
|
|
103
|
+
# Keep track of the cuts already computed so we do not repeat them.
|
|
104
|
+
seen = []
|
|
105
|
+
# Even-Tarjan reduction is what we call auxiliary digraph
|
|
106
|
+
# for node connectivity.
|
|
107
|
+
H = build_auxiliary_node_connectivity(G)
|
|
108
|
+
H_nodes = H.nodes # for speed
|
|
109
|
+
mapping = H.graph["mapping"]
|
|
110
|
+
# Keep a copy of original predecessors, H will be modified later.
|
|
111
|
+
# Shallow copy is enough.
|
|
112
|
+
original_H_pred = copy.copy(H._pred)
|
|
113
|
+
R = build_residual_network(H, "capacity")
|
|
114
|
+
kwargs = {"capacity": "capacity", "residual": R}
|
|
115
|
+
# Define default flow function
|
|
116
|
+
if flow_func is None:
|
|
117
|
+
flow_func = default_flow_func
|
|
118
|
+
if flow_func is shortest_augmenting_path:
|
|
119
|
+
kwargs["two_phase"] = True
|
|
120
|
+
# Begin the actual algorithm
|
|
121
|
+
# step 1: Find node connectivity k of G
|
|
122
|
+
if k is None:
|
|
123
|
+
k = nx.node_connectivity(G, flow_func=flow_func)
|
|
124
|
+
# step 2:
|
|
125
|
+
# Find k nodes with top degree, call it X:
|
|
126
|
+
X = {n for n, d in sorted(G.degree(), key=itemgetter(1), reverse=True)[:k]}
|
|
127
|
+
# Check if X is a k-node-cutset
|
|
128
|
+
if _is_separating_set(G, X):
|
|
129
|
+
seen.append(X)
|
|
130
|
+
yield X
|
|
131
|
+
|
|
132
|
+
for x in X:
|
|
133
|
+
# step 3: Compute local connectivity flow of x with all other
|
|
134
|
+
# non adjacent nodes in G
|
|
135
|
+
non_adjacent = set(G) - {x} - set(G[x])
|
|
136
|
+
for v in non_adjacent:
|
|
137
|
+
# step 4: compute maximum flow in an Even-Tarjan reduction H of G
|
|
138
|
+
# and step 5: build the associated residual network R
|
|
139
|
+
R = flow_func(H, f"{mapping[x]}B", f"{mapping[v]}A", **kwargs)
|
|
140
|
+
flow_value = R.graph["flow_value"]
|
|
141
|
+
|
|
142
|
+
if flow_value == k:
|
|
143
|
+
# Find the nodes incident to the flow.
|
|
144
|
+
E1 = flowed_edges = [
|
|
145
|
+
(u, w) for (u, w, d) in R.edges(data=True) if d["flow"] != 0
|
|
146
|
+
]
|
|
147
|
+
VE1 = incident_nodes = {n for edge in E1 for n in edge}
|
|
148
|
+
# Remove saturated edges form the residual network.
|
|
149
|
+
# Note that reversed edges are introduced with capacity 0
|
|
150
|
+
# in the residual graph and they need to be removed too.
|
|
151
|
+
saturated_edges = [
|
|
152
|
+
(u, w, d)
|
|
153
|
+
for (u, w, d) in R.edges(data=True)
|
|
154
|
+
if d["capacity"] == d["flow"] or d["capacity"] == 0
|
|
155
|
+
]
|
|
156
|
+
R.remove_edges_from(saturated_edges)
|
|
157
|
+
R_closure = nx.transitive_closure(R)
|
|
158
|
+
# step 6: shrink the strongly connected components of
|
|
159
|
+
# residual flow network R and call it L.
|
|
160
|
+
L = nx.condensation(R)
|
|
161
|
+
cmap = L.graph["mapping"]
|
|
162
|
+
inv_cmap = defaultdict(list)
|
|
163
|
+
for n, scc in cmap.items():
|
|
164
|
+
inv_cmap[scc].append(n)
|
|
165
|
+
# Find the incident nodes in the condensed graph.
|
|
166
|
+
VE1 = {cmap[n] for n in VE1}
|
|
167
|
+
# step 7: Compute all antichains of L;
|
|
168
|
+
# they map to closed sets in H.
|
|
169
|
+
# Any edge in H that links a closed set is part of a cutset.
|
|
170
|
+
for antichain in nx.antichains(L):
|
|
171
|
+
# Only antichains that are subsets of incident nodes counts.
|
|
172
|
+
# Lemma 8 in reference.
|
|
173
|
+
if not set(antichain).issubset(VE1):
|
|
174
|
+
continue
|
|
175
|
+
# Nodes in an antichain of the condensation graph of
|
|
176
|
+
# the residual network map to a closed set of nodes that
|
|
177
|
+
# define a node partition of the auxiliary digraph H
|
|
178
|
+
# through taking all of antichain's predecessors in the
|
|
179
|
+
# transitive closure.
|
|
180
|
+
S = set()
|
|
181
|
+
for scc in antichain:
|
|
182
|
+
S.update(inv_cmap[scc])
|
|
183
|
+
S_ancestors = set()
|
|
184
|
+
for n in S:
|
|
185
|
+
S_ancestors.update(R_closure._pred[n])
|
|
186
|
+
S.update(S_ancestors)
|
|
187
|
+
if f"{mapping[x]}B" not in S or f"{mapping[v]}A" in S:
|
|
188
|
+
continue
|
|
189
|
+
# Find the cutset that links the node partition (S,~S) in H
|
|
190
|
+
cutset = set()
|
|
191
|
+
for u in S:
|
|
192
|
+
cutset.update((u, w) for w in original_H_pred[u] if w not in S)
|
|
193
|
+
# The edges in H that form the cutset are internal edges
|
|
194
|
+
# (ie edges that represent a node of the original graph G)
|
|
195
|
+
if any(H_nodes[u]["id"] != H_nodes[w]["id"] for u, w in cutset):
|
|
196
|
+
continue
|
|
197
|
+
node_cut = {H_nodes[u]["id"] for u, _ in cutset}
|
|
198
|
+
|
|
199
|
+
if len(node_cut) == k:
|
|
200
|
+
# The cut is invalid if it includes internal edges of
|
|
201
|
+
# end nodes. The other half of Lemma 8 in ref.
|
|
202
|
+
if x in node_cut or v in node_cut:
|
|
203
|
+
continue
|
|
204
|
+
if node_cut not in seen:
|
|
205
|
+
yield node_cut
|
|
206
|
+
seen.append(node_cut)
|
|
207
|
+
|
|
208
|
+
# Add an edge (x, v) to make sure that we do not
|
|
209
|
+
# find this cutset again. This is equivalent
|
|
210
|
+
# of adding the edge in the input graph
|
|
211
|
+
# G.add_edge(x, v) and then regenerate H and R:
|
|
212
|
+
# Add edges to the auxiliary digraph.
|
|
213
|
+
# See build_residual_network for convention we used
|
|
214
|
+
# in residual graphs.
|
|
215
|
+
H.add_edge(f"{mapping[x]}B", f"{mapping[v]}A", capacity=1)
|
|
216
|
+
H.add_edge(f"{mapping[v]}B", f"{mapping[x]}A", capacity=1)
|
|
217
|
+
# Add edges to the residual network.
|
|
218
|
+
R.add_edge(f"{mapping[x]}B", f"{mapping[v]}A", capacity=1)
|
|
219
|
+
R.add_edge(f"{mapping[v]}A", f"{mapping[x]}B", capacity=0)
|
|
220
|
+
R.add_edge(f"{mapping[v]}B", f"{mapping[x]}A", capacity=1)
|
|
221
|
+
R.add_edge(f"{mapping[x]}A", f"{mapping[v]}B", capacity=0)
|
|
222
|
+
|
|
223
|
+
# Add again the saturated edges to reuse the residual network
|
|
224
|
+
R.add_edges_from(saturated_edges)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _is_separating_set(G, cut):
|
|
228
|
+
"""Assumes that the input graph is connected"""
|
|
229
|
+
if len(cut) == len(G) - 1:
|
|
230
|
+
return True
|
|
231
|
+
|
|
232
|
+
H = nx.restricted_view(G, cut, [])
|
|
233
|
+
if nx.is_connected(H):
|
|
234
|
+
return False
|
|
235
|
+
return True
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Stoer-Wagner minimum cut algorithm.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from itertools import islice
|
|
6
|
+
|
|
7
|
+
import networkx as nx
|
|
8
|
+
|
|
9
|
+
from ...utils import BinaryHeap, arbitrary_element, not_implemented_for
|
|
10
|
+
|
|
11
|
+
__all__ = ["stoer_wagner"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@not_implemented_for("directed")
|
|
15
|
+
@not_implemented_for("multigraph")
|
|
16
|
+
@nx._dispatchable(edge_attrs="weight")
|
|
17
|
+
def stoer_wagner(G, weight="weight", heap=BinaryHeap):
|
|
18
|
+
r"""Returns the weighted minimum edge cut using the Stoer-Wagner algorithm.
|
|
19
|
+
|
|
20
|
+
Determine the minimum edge cut of a connected graph using the
|
|
21
|
+
Stoer-Wagner algorithm. In weighted cases, all weights must be
|
|
22
|
+
nonnegative.
|
|
23
|
+
|
|
24
|
+
The running time of the algorithm depends on the type of heaps used:
|
|
25
|
+
|
|
26
|
+
============== =============================================
|
|
27
|
+
Type of heap Running time
|
|
28
|
+
============== =============================================
|
|
29
|
+
Binary heap $O(n (m + n) \log n)$
|
|
30
|
+
Fibonacci heap $O(nm + n^2 \log n)$
|
|
31
|
+
Pairing heap $O(2^{2 \sqrt{\log \log n}} nm + n^2 \log n)$
|
|
32
|
+
============== =============================================
|
|
33
|
+
|
|
34
|
+
Parameters
|
|
35
|
+
----------
|
|
36
|
+
G : NetworkX graph
|
|
37
|
+
Edges of the graph are expected to have an attribute named by the
|
|
38
|
+
weight parameter below. If this attribute is not present, the edge is
|
|
39
|
+
considered to have unit weight.
|
|
40
|
+
|
|
41
|
+
weight : string
|
|
42
|
+
Name of the weight attribute of the edges. If the attribute is not
|
|
43
|
+
present, unit weight is assumed. Default value: 'weight'.
|
|
44
|
+
|
|
45
|
+
heap : class
|
|
46
|
+
Type of heap to be used in the algorithm. It should be a subclass of
|
|
47
|
+
:class:`MinHeap` or implement a compatible interface.
|
|
48
|
+
|
|
49
|
+
If a stock heap implementation is to be used, :class:`BinaryHeap` is
|
|
50
|
+
recommended over :class:`PairingHeap` for Python implementations without
|
|
51
|
+
optimized attribute accesses (e.g., CPython) despite a slower
|
|
52
|
+
asymptotic running time. For Python implementations with optimized
|
|
53
|
+
attribute accesses (e.g., PyPy), :class:`PairingHeap` provides better
|
|
54
|
+
performance. Default value: :class:`BinaryHeap`.
|
|
55
|
+
|
|
56
|
+
Returns
|
|
57
|
+
-------
|
|
58
|
+
cut_value : integer or float
|
|
59
|
+
The sum of weights of edges in a minimum cut.
|
|
60
|
+
|
|
61
|
+
partition : pair of node lists
|
|
62
|
+
A partitioning of the nodes that defines a minimum cut.
|
|
63
|
+
|
|
64
|
+
Raises
|
|
65
|
+
------
|
|
66
|
+
NetworkXNotImplemented
|
|
67
|
+
If the graph is directed or a multigraph.
|
|
68
|
+
|
|
69
|
+
NetworkXError
|
|
70
|
+
If the graph has less than two nodes, is not connected or has a
|
|
71
|
+
negative-weighted edge.
|
|
72
|
+
|
|
73
|
+
Examples
|
|
74
|
+
--------
|
|
75
|
+
>>> G = nx.Graph()
|
|
76
|
+
>>> G.add_edge("x", "a", weight=3)
|
|
77
|
+
>>> G.add_edge("x", "b", weight=1)
|
|
78
|
+
>>> G.add_edge("a", "c", weight=3)
|
|
79
|
+
>>> G.add_edge("b", "c", weight=5)
|
|
80
|
+
>>> G.add_edge("b", "d", weight=4)
|
|
81
|
+
>>> G.add_edge("d", "e", weight=2)
|
|
82
|
+
>>> G.add_edge("c", "y", weight=2)
|
|
83
|
+
>>> G.add_edge("e", "y", weight=3)
|
|
84
|
+
>>> cut_value, partition = nx.stoer_wagner(G)
|
|
85
|
+
>>> cut_value
|
|
86
|
+
4
|
|
87
|
+
"""
|
|
88
|
+
n = len(G)
|
|
89
|
+
if n < 2:
|
|
90
|
+
raise nx.NetworkXError("graph has less than two nodes.")
|
|
91
|
+
if not nx.is_connected(G):
|
|
92
|
+
raise nx.NetworkXError("graph is not connected.")
|
|
93
|
+
|
|
94
|
+
# Make a copy of the graph for internal use.
|
|
95
|
+
G = nx.Graph(
|
|
96
|
+
(u, v, {"weight": e.get(weight, 1)}) for u, v, e in G.edges(data=True) if u != v
|
|
97
|
+
)
|
|
98
|
+
G.__networkx_cache__ = None # Disable caching
|
|
99
|
+
|
|
100
|
+
for u, v, e in G.edges(data=True):
|
|
101
|
+
if e["weight"] < 0:
|
|
102
|
+
raise nx.NetworkXError("graph has a negative-weighted edge.")
|
|
103
|
+
|
|
104
|
+
cut_value = float("inf")
|
|
105
|
+
nodes = set(G)
|
|
106
|
+
contractions = [] # contracted node pairs
|
|
107
|
+
|
|
108
|
+
# Repeatedly pick a pair of nodes to contract until only one node is left.
|
|
109
|
+
for i in range(n - 1):
|
|
110
|
+
# Pick an arbitrary node u and create a set A = {u}.
|
|
111
|
+
u = arbitrary_element(G)
|
|
112
|
+
A = {u}
|
|
113
|
+
# Repeatedly pick the node "most tightly connected" to A and add it to
|
|
114
|
+
# A. The tightness of connectivity of a node not in A is defined by the
|
|
115
|
+
# of edges connecting it to nodes in A.
|
|
116
|
+
h = heap() # min-heap emulating a max-heap
|
|
117
|
+
for v, e in G[u].items():
|
|
118
|
+
h.insert(v, -e["weight"])
|
|
119
|
+
# Repeat until all but one node has been added to A.
|
|
120
|
+
for j in range(n - i - 2):
|
|
121
|
+
u = h.pop()[0]
|
|
122
|
+
A.add(u)
|
|
123
|
+
for v, e in G[u].items():
|
|
124
|
+
if v not in A:
|
|
125
|
+
h.insert(v, h.get(v, 0) - e["weight"])
|
|
126
|
+
# A and the remaining node v define a "cut of the phase". There is a
|
|
127
|
+
# minimum cut of the original graph that is also a cut of the phase.
|
|
128
|
+
# Due to contractions in earlier phases, v may in fact represent
|
|
129
|
+
# multiple nodes in the original graph.
|
|
130
|
+
v, w = h.min()
|
|
131
|
+
w = -w
|
|
132
|
+
if w < cut_value:
|
|
133
|
+
cut_value = w
|
|
134
|
+
best_phase = i
|
|
135
|
+
# Contract v and the last node added to A.
|
|
136
|
+
contractions.append((u, v))
|
|
137
|
+
for w, e in G[v].items():
|
|
138
|
+
if w != u:
|
|
139
|
+
if w not in G[u]:
|
|
140
|
+
G.add_edge(u, w, weight=e["weight"])
|
|
141
|
+
else:
|
|
142
|
+
G[u][w]["weight"] += e["weight"]
|
|
143
|
+
G.remove_node(v)
|
|
144
|
+
|
|
145
|
+
# Recover the optimal partitioning from the contractions.
|
|
146
|
+
G = nx.Graph(islice(contractions, best_phase))
|
|
147
|
+
v = contractions[best_phase][1]
|
|
148
|
+
G.add_node(v)
|
|
149
|
+
reachable = set(nx.single_source_shortest_path_length(G, v))
|
|
150
|
+
partition = (list(reachable), list(nodes - reachable))
|
|
151
|
+
|
|
152
|
+
return cut_value, partition
|
|
File without changes
|