okstra 0.107.2 → 0.109.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/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/prompts/lead/okstra-lead-contract.md +1 -1
- package/runtime/prompts/profiles/_common-contract.md +3 -2
- 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/session.py +44 -0
- package/runtime/python/okstra_project/__init__.py +2 -0
- package/runtime/python/okstra_project/state.py +36 -0
- package/runtime/python/okstra_token_usage/claude.py +15 -9
- package/runtime/python/okstra_token_usage/cli.py +23 -0
- package/runtime/python/okstra_token_usage/collect.py +163 -4
- 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/runtime/validators/forbidden_actions.py +8 -2
- package/runtime/validators/validate_session_conformance.py +26 -5
- 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
package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphism.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from functools import partial
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
import networkx as nx
|
|
6
|
+
from networkx.algorithms import isomorphism as iso
|
|
7
|
+
|
|
8
|
+
# Convenience functions for testing that the behavior of `could_be_isomorphic`
|
|
9
|
+
# with the "properties" kwarg is equivalent to the corresponding function (i.e.
|
|
10
|
+
# nx.fast_could_be_isomorphic or nx.faster_could_be_isomorphic)
|
|
11
|
+
fast_cbi = partial(nx.could_be_isomorphic, properties="dt")
|
|
12
|
+
faster_cbi = partial(nx.could_be_isomorphic, properties="d")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_graph_could_be_isomorphic_variants_deprecated():
|
|
16
|
+
G1 = nx.Graph([(1, 2), (1, 3), (1, 5), (2, 3)])
|
|
17
|
+
G2 = nx.Graph([(10, 20), (20, 30), (10, 30), (10, 50)])
|
|
18
|
+
with pytest.deprecated_call(): # graph_could_be_isomorphic
|
|
19
|
+
result = nx.isomorphism.isomorph.graph_could_be_isomorphic(G1, G2)
|
|
20
|
+
assert nx.could_be_isomorphic(G1, G2) == result
|
|
21
|
+
with pytest.deprecated_call(): # fast_graph_could_be_isomorphic
|
|
22
|
+
result = nx.isomorphism.isomorph.fast_graph_could_be_isomorphic(G1, G2)
|
|
23
|
+
assert nx.fast_could_be_isomorphic(G1, G2) == result
|
|
24
|
+
with pytest.deprecated_call():
|
|
25
|
+
result = nx.isomorphism.isomorph.faster_graph_could_be_isomorphic(G1, G2)
|
|
26
|
+
assert nx.faster_could_be_isomorphic(G1, G2) == result
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@pytest.mark.parametrize("atlas_ids", [(699, 706), (864, 870)])
|
|
30
|
+
def test_could_be_isomorphic_combined_properties(atlas_ids):
|
|
31
|
+
"""There are two pairs of graphs from the graph atlas that have the same
|
|
32
|
+
combined degree-triangle distribution, but a different maximal clique
|
|
33
|
+
distribution. See gh-7852."""
|
|
34
|
+
G, H = (nx.graph_atlas(idx) for idx in atlas_ids)
|
|
35
|
+
|
|
36
|
+
assert not nx.is_isomorphic(G, H)
|
|
37
|
+
|
|
38
|
+
# Degree only
|
|
39
|
+
assert nx.faster_could_be_isomorphic(G, H)
|
|
40
|
+
assert nx.could_be_isomorphic(G, H, properties="d")
|
|
41
|
+
# Degrees & triangles
|
|
42
|
+
assert nx.fast_could_be_isomorphic(G, H)
|
|
43
|
+
assert nx.could_be_isomorphic(G, H, properties="dt")
|
|
44
|
+
# Full properties table (degrees, triangles, cliques)
|
|
45
|
+
assert not nx.could_be_isomorphic(G, H)
|
|
46
|
+
assert not nx.could_be_isomorphic(G, H, properties="dtc")
|
|
47
|
+
# For these two cases, the clique distribution alone is enough to verify
|
|
48
|
+
# the graphs can't be isomorphic
|
|
49
|
+
assert not nx.could_be_isomorphic(G, H, properties="c")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def test_could_be_isomorphic_individual_vs_combined_dt():
|
|
53
|
+
"""A test case where G and H have identical degree and triangle distributions,
|
|
54
|
+
but are different when compared together"""
|
|
55
|
+
G = nx.Graph([(0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (3, 4), (4, 5), (4, 6)])
|
|
56
|
+
H = G.copy()
|
|
57
|
+
# Modify graphs to produce different clique distributions
|
|
58
|
+
G.add_edge(0, 7)
|
|
59
|
+
H.add_edge(4, 7)
|
|
60
|
+
assert nx.could_be_isomorphic(G, H, properties="d")
|
|
61
|
+
assert nx.could_be_isomorphic(G, H, properties="t")
|
|
62
|
+
assert not nx.could_be_isomorphic(G, H, properties="dt")
|
|
63
|
+
assert not nx.could_be_isomorphic(G, H, properties="c")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class TestIsomorph:
|
|
67
|
+
@classmethod
|
|
68
|
+
def setup_class(cls):
|
|
69
|
+
cls.G1 = nx.Graph([[1, 2], [1, 3], [1, 5], [2, 3]])
|
|
70
|
+
cls.G2 = nx.Graph([[10, 20], [20, 30], [10, 30], [10, 50]])
|
|
71
|
+
cls.G3 = nx.Graph([[1, 2], [1, 3], [1, 5], [2, 5]])
|
|
72
|
+
cls.G4 = nx.Graph([[1, 2], [1, 3], [1, 5], [2, 4]])
|
|
73
|
+
cls.G5 = nx.Graph([[1, 2], [1, 3]])
|
|
74
|
+
cls.G6 = nx.Graph([[10, 20], [20, 30], [10, 30], [10, 50], [20, 50]])
|
|
75
|
+
|
|
76
|
+
def test_could_be_isomorphic(self):
|
|
77
|
+
assert iso.could_be_isomorphic(self.G1, self.G2)
|
|
78
|
+
assert iso.could_be_isomorphic(self.G1, self.G3)
|
|
79
|
+
assert not iso.could_be_isomorphic(self.G1, self.G4)
|
|
80
|
+
assert iso.could_be_isomorphic(self.G3, self.G2)
|
|
81
|
+
assert not iso.could_be_isomorphic(self.G1, self.G6)
|
|
82
|
+
|
|
83
|
+
@pytest.mark.parametrize("fn", (iso.fast_could_be_isomorphic, fast_cbi))
|
|
84
|
+
def test_fast_could_be_isomorphic(self, fn):
|
|
85
|
+
assert fn(self.G3, self.G2)
|
|
86
|
+
assert not fn(self.G3, self.G5)
|
|
87
|
+
assert not fn(self.G1, self.G6)
|
|
88
|
+
|
|
89
|
+
@pytest.mark.parametrize("fn", (iso.faster_could_be_isomorphic, faster_cbi))
|
|
90
|
+
def test_faster_could_be_isomorphic(self, fn):
|
|
91
|
+
assert fn(self.G3, self.G2)
|
|
92
|
+
assert not fn(self.G3, self.G5)
|
|
93
|
+
assert not fn(self.G1, self.G6)
|
|
94
|
+
|
|
95
|
+
def test_is_isomorphic(self):
|
|
96
|
+
assert iso.is_isomorphic(self.G1, self.G2)
|
|
97
|
+
assert not iso.is_isomorphic(self.G1, self.G4)
|
|
98
|
+
assert iso.is_isomorphic(self.G1.to_directed(), self.G2.to_directed())
|
|
99
|
+
assert not iso.is_isomorphic(self.G1.to_directed(), self.G4.to_directed())
|
|
100
|
+
with pytest.raises(
|
|
101
|
+
nx.NetworkXError, match="Graphs G1 and G2 are not of the same type."
|
|
102
|
+
):
|
|
103
|
+
iso.is_isomorphic(self.G1.to_directed(), self.G1)
|
package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_isomorphvf2.py
ADDED
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tests for VF2 isomorphism algorithm.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import importlib.resources
|
|
6
|
+
import random
|
|
7
|
+
import struct
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
|
|
11
|
+
import networkx as nx
|
|
12
|
+
from networkx.algorithms import isomorphism as iso
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TestWikipediaExample:
|
|
16
|
+
# Source: https://en.wikipedia.org/wiki/Graph_isomorphism
|
|
17
|
+
|
|
18
|
+
# Nodes 'a', 'b', 'c' and 'd' form a column.
|
|
19
|
+
# Nodes 'g', 'h', 'i' and 'j' form a column.
|
|
20
|
+
# isomorphism: {'a': 1, 'g': 2, 'b': 3, 'c': 6, 'h': 4, 'i': 5, 'j': 7, 'd': 8}
|
|
21
|
+
g1edges = [
|
|
22
|
+
["a", "g"],
|
|
23
|
+
["a", "h"],
|
|
24
|
+
["a", "i"],
|
|
25
|
+
["b", "g"],
|
|
26
|
+
["b", "h"],
|
|
27
|
+
["b", "j"],
|
|
28
|
+
["c", "g"],
|
|
29
|
+
["c", "i"],
|
|
30
|
+
["c", "j"],
|
|
31
|
+
["d", "h"],
|
|
32
|
+
["d", "i"],
|
|
33
|
+
["d", "j"],
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
# Nodes 1,2,3,4 form the clockwise corners of a large square.
|
|
37
|
+
# Nodes 5,6,7,8 form the clockwise corners of a small square
|
|
38
|
+
g2edges = [
|
|
39
|
+
[1, 2],
|
|
40
|
+
[3, 2],
|
|
41
|
+
[3, 4],
|
|
42
|
+
[1, 4],
|
|
43
|
+
[6, 5],
|
|
44
|
+
[6, 7],
|
|
45
|
+
[8, 7],
|
|
46
|
+
[8, 5],
|
|
47
|
+
[1, 5],
|
|
48
|
+
[6, 2],
|
|
49
|
+
[3, 7],
|
|
50
|
+
[8, 4],
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
@pytest.mark.parametrize(
|
|
54
|
+
["graph_class", "numb_maps"], [(nx.Graph, 48), (nx.DiGraph, 24)]
|
|
55
|
+
)
|
|
56
|
+
def test_morphic_and_number_of_mappings(self, graph_class, numb_maps):
|
|
57
|
+
g1 = graph_class(self.g1edges)
|
|
58
|
+
g2 = graph_class(self.g2edges)
|
|
59
|
+
Matcher = iso.DiGraphMatcher if g1.is_directed() else iso.GraphMatcher
|
|
60
|
+
gm = Matcher(g1, g2)
|
|
61
|
+
assert gm.is_isomorphic()
|
|
62
|
+
assert gm.subgraph_is_monomorphic()
|
|
63
|
+
assert gm.subgraph_is_isomorphic()
|
|
64
|
+
|
|
65
|
+
mapping = list(gm.mapping.items())
|
|
66
|
+
# this mapping is only one of the 48 possibilities
|
|
67
|
+
all_mappings = list(gm.isomorphisms_iter())
|
|
68
|
+
assert len(all_mappings) == numb_maps
|
|
69
|
+
assert dict(mapping) in all_mappings
|
|
70
|
+
|
|
71
|
+
@pytest.mark.parametrize("graph_class", [nx.Graph, nx.DiGraph])
|
|
72
|
+
def test_subgraph(self, graph_class):
|
|
73
|
+
g1 = graph_class(self.g1edges)
|
|
74
|
+
g2 = graph_class(self.g2edges)
|
|
75
|
+
g3 = g2.subgraph([1, 2, 3, 4])
|
|
76
|
+
Matcher = iso.DiGraphMatcher if g1.is_directed() else iso.GraphMatcher
|
|
77
|
+
gm = Matcher(g1, g3)
|
|
78
|
+
assert not gm.is_isomorphic()
|
|
79
|
+
assert gm.subgraph_is_isomorphic()
|
|
80
|
+
assert gm.subgraph_is_monomorphic()
|
|
81
|
+
|
|
82
|
+
@pytest.mark.parametrize("graph_class", [nx.Graph, nx.DiGraph])
|
|
83
|
+
def test_subgraph_mono(self, graph_class):
|
|
84
|
+
g1 = graph_class(self.g1edges)
|
|
85
|
+
g2 = graph_class(["ag", "cg", "ci", "di", "bg"])
|
|
86
|
+
Matcher = iso.DiGraphMatcher if g1.is_directed() else iso.GraphMatcher
|
|
87
|
+
gm = Matcher(g1, g2)
|
|
88
|
+
assert not gm.is_isomorphic()
|
|
89
|
+
assert not gm.subgraph_is_isomorphic()
|
|
90
|
+
assert gm.subgraph_is_monomorphic()
|
|
91
|
+
|
|
92
|
+
# note: this shows need to recreate the matcher for each graph change
|
|
93
|
+
# Also checking not monomorphic
|
|
94
|
+
g2.add_edge("c", "a")
|
|
95
|
+
gm = Matcher(g1, g2)
|
|
96
|
+
assert not gm.subgraph_is_monomorphic()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class TestVF2GraphDB:
|
|
100
|
+
# https://web.archive.org/web/20090303210205/http://amalfi.dis.unina.it/graph/db/
|
|
101
|
+
|
|
102
|
+
@staticmethod
|
|
103
|
+
def create_graph(filename):
|
|
104
|
+
"""Creates a Graph instance from the filename."""
|
|
105
|
+
|
|
106
|
+
# The file is assumed to be in the format from the VF2 graph database.
|
|
107
|
+
# Each file is composed of 16-bit numbers (unsigned short int).
|
|
108
|
+
# So we will want to read 2 bytes at a time.
|
|
109
|
+
|
|
110
|
+
# We can read the number as follows:
|
|
111
|
+
# number = struct.unpack('<H', file.read(2))
|
|
112
|
+
# This says, expect the data in little-endian encoding
|
|
113
|
+
# as an unsigned short int and unpack 2 bytes from the file.
|
|
114
|
+
|
|
115
|
+
fh = open(filename, mode="rb")
|
|
116
|
+
|
|
117
|
+
# Grab the number of nodes.
|
|
118
|
+
# Node numeration is 0-based, so the first node has index 0.
|
|
119
|
+
nodes = struct.unpack("<H", fh.read(2))[0]
|
|
120
|
+
|
|
121
|
+
graph = nx.Graph()
|
|
122
|
+
for from_node in range(nodes):
|
|
123
|
+
# Get the number of edges.
|
|
124
|
+
edges = struct.unpack("<H", fh.read(2))[0]
|
|
125
|
+
for edge in range(edges):
|
|
126
|
+
# Get the terminal node.
|
|
127
|
+
to_node = struct.unpack("<H", fh.read(2))[0]
|
|
128
|
+
graph.add_edge(from_node, to_node)
|
|
129
|
+
|
|
130
|
+
fh.close()
|
|
131
|
+
return graph
|
|
132
|
+
|
|
133
|
+
def test_graph(self):
|
|
134
|
+
head = importlib.resources.files("networkx.algorithms.isomorphism.tests")
|
|
135
|
+
g1 = self.create_graph(head / "iso_r01_s80.A99")
|
|
136
|
+
g2 = self.create_graph(head / "iso_r01_s80.B99")
|
|
137
|
+
gm = iso.GraphMatcher(g1, g2)
|
|
138
|
+
assert gm.is_isomorphic()
|
|
139
|
+
|
|
140
|
+
def test_subgraph(self):
|
|
141
|
+
# A is the subgraph
|
|
142
|
+
# B is the full graph
|
|
143
|
+
head = importlib.resources.files("networkx.algorithms.isomorphism.tests")
|
|
144
|
+
subgraph = self.create_graph(head / "si2_b06_m200.A99")
|
|
145
|
+
graph = self.create_graph(head / "si2_b06_m200.B99")
|
|
146
|
+
gm = iso.GraphMatcher(graph, subgraph)
|
|
147
|
+
assert not gm.is_isomorphic()
|
|
148
|
+
assert gm.subgraph_is_isomorphic()
|
|
149
|
+
assert gm.subgraph_is_monomorphic()
|
|
150
|
+
|
|
151
|
+
def test_subgraph_monomorphic(self):
|
|
152
|
+
# A is the subgraph
|
|
153
|
+
# B is the full graph
|
|
154
|
+
head = importlib.resources.files("networkx.algorithms.isomorphism.tests")
|
|
155
|
+
subgraph = self.create_graph(head / "si2_b06_m200.A99")
|
|
156
|
+
graph = self.create_graph(head / "si2_b06_m200.B99")
|
|
157
|
+
subgraph.remove_edge(29, 28)
|
|
158
|
+
gm = iso.GraphMatcher(graph, subgraph)
|
|
159
|
+
assert not gm.is_isomorphic()
|
|
160
|
+
assert not gm.subgraph_is_isomorphic()
|
|
161
|
+
assert gm.subgraph_is_monomorphic()
|
|
162
|
+
|
|
163
|
+
# now add new edge to make sg no longer monomorphic
|
|
164
|
+
subgraph.add_edge(29, 2)
|
|
165
|
+
assert not gm.subgraph_is_monomorphic()
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class TestAtlas:
|
|
169
|
+
@classmethod
|
|
170
|
+
def setup_class(cls):
|
|
171
|
+
global atlas
|
|
172
|
+
from networkx.generators import atlas
|
|
173
|
+
|
|
174
|
+
cls.GAG = atlas.graph_atlas_g()
|
|
175
|
+
|
|
176
|
+
def test_graph_atlas(self):
|
|
177
|
+
rng = random.Random(42)
|
|
178
|
+
# Atlas = nx.graph_atlas_g()[0:208] # 208, 6 nodes or less
|
|
179
|
+
Atlas = self.GAG[0:100]
|
|
180
|
+
alphabet = list(range(26))
|
|
181
|
+
for graph in Atlas:
|
|
182
|
+
nlist = list(graph)
|
|
183
|
+
labels = alphabet[: len(nlist)]
|
|
184
|
+
for _ in range(10):
|
|
185
|
+
rng.shuffle(labels)
|
|
186
|
+
d = dict(zip(nlist, labels))
|
|
187
|
+
relabel = nx.relabel_nodes(graph, d)
|
|
188
|
+
gm = iso.GraphMatcher(graph, relabel)
|
|
189
|
+
assert gm.is_isomorphic()
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def test_multiedge():
|
|
193
|
+
# Simple test for multigraphs
|
|
194
|
+
# Need something much more rigorous
|
|
195
|
+
edges = [
|
|
196
|
+
(0, 1),
|
|
197
|
+
(1, 2),
|
|
198
|
+
(2, 3),
|
|
199
|
+
(3, 4),
|
|
200
|
+
(4, 5),
|
|
201
|
+
(5, 6),
|
|
202
|
+
(6, 7),
|
|
203
|
+
(7, 8),
|
|
204
|
+
(8, 9),
|
|
205
|
+
(9, 10),
|
|
206
|
+
(10, 11),
|
|
207
|
+
(10, 11),
|
|
208
|
+
(11, 12),
|
|
209
|
+
(11, 12),
|
|
210
|
+
(12, 13),
|
|
211
|
+
(12, 13),
|
|
212
|
+
(13, 14),
|
|
213
|
+
(13, 14),
|
|
214
|
+
(14, 15),
|
|
215
|
+
(14, 15),
|
|
216
|
+
(15, 16),
|
|
217
|
+
(15, 16),
|
|
218
|
+
(16, 17),
|
|
219
|
+
(16, 17),
|
|
220
|
+
(17, 18),
|
|
221
|
+
(17, 18),
|
|
222
|
+
(18, 19),
|
|
223
|
+
(18, 19),
|
|
224
|
+
(19, 0),
|
|
225
|
+
(19, 0),
|
|
226
|
+
]
|
|
227
|
+
nodes = list(range(20))
|
|
228
|
+
|
|
229
|
+
rng = random.Random(42)
|
|
230
|
+
|
|
231
|
+
for g1 in [nx.MultiGraph(), nx.MultiDiGraph()]:
|
|
232
|
+
g1.add_edges_from(edges)
|
|
233
|
+
for _ in range(10):
|
|
234
|
+
new_nodes = list(nodes)
|
|
235
|
+
rng.shuffle(new_nodes)
|
|
236
|
+
d = dict(zip(nodes, new_nodes))
|
|
237
|
+
g2 = nx.relabel_nodes(g1, d)
|
|
238
|
+
if not g1.is_directed():
|
|
239
|
+
gm = iso.GraphMatcher(g1, g2)
|
|
240
|
+
else:
|
|
241
|
+
gm = iso.DiGraphMatcher(g1, g2)
|
|
242
|
+
assert gm.is_isomorphic()
|
|
243
|
+
# Testing if monomorphism works in multigraphs
|
|
244
|
+
assert gm.subgraph_is_monomorphic()
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
@pytest.mark.parametrize("G1", [nx.Graph(), nx.MultiGraph()])
|
|
248
|
+
@pytest.mark.parametrize("G2", [nx.Graph(), nx.MultiGraph()])
|
|
249
|
+
def test_matcher_raises(G1, G2):
|
|
250
|
+
undirected_matchers = [iso.GraphMatcher, iso.MultiGraphMatcher]
|
|
251
|
+
directed_matchers = [iso.DiGraphMatcher, iso.MultiDiGraphMatcher]
|
|
252
|
+
|
|
253
|
+
for matcher in undirected_matchers:
|
|
254
|
+
matcher(G1, G2)
|
|
255
|
+
|
|
256
|
+
msg = r"\(Multi-\)GraphMatcher\(\) not defined for directed graphs"
|
|
257
|
+
with pytest.raises(nx.NetworkXError, match=msg):
|
|
258
|
+
matcher(G1.to_directed(), G2.to_directed())
|
|
259
|
+
|
|
260
|
+
for matcher in directed_matchers:
|
|
261
|
+
matcher(G1.to_directed(), G2.to_directed())
|
|
262
|
+
|
|
263
|
+
msg = r"\(Multi-\)DiGraphMatcher\(\) not defined for undirected graphs"
|
|
264
|
+
with pytest.raises(nx.NetworkXError, match=msg):
|
|
265
|
+
matcher(G1, G2)
|
|
266
|
+
|
|
267
|
+
for matcher in undirected_matchers + directed_matchers:
|
|
268
|
+
msg = r"G1 and G2 must have the same directedness"
|
|
269
|
+
with pytest.raises(nx.NetworkXError, match=msg):
|
|
270
|
+
matcher(G1, G2.to_directed())
|
|
271
|
+
with pytest.raises(nx.NetworkXError, match=msg):
|
|
272
|
+
matcher(G1.to_directed(), G2)
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def test_selfloop():
|
|
276
|
+
# Simple test for graphs with selfloops
|
|
277
|
+
edges = [
|
|
278
|
+
(0, 1),
|
|
279
|
+
(0, 2),
|
|
280
|
+
(1, 2),
|
|
281
|
+
(1, 3),
|
|
282
|
+
(2, 2),
|
|
283
|
+
(2, 4),
|
|
284
|
+
(3, 1),
|
|
285
|
+
(3, 2),
|
|
286
|
+
(4, 2),
|
|
287
|
+
(4, 5),
|
|
288
|
+
(5, 4),
|
|
289
|
+
]
|
|
290
|
+
nodes = list(range(6))
|
|
291
|
+
|
|
292
|
+
rng = random.Random(42)
|
|
293
|
+
|
|
294
|
+
for g1 in [nx.Graph(), nx.DiGraph()]:
|
|
295
|
+
g1.add_edges_from(edges)
|
|
296
|
+
for _ in range(100):
|
|
297
|
+
new_nodes = list(nodes)
|
|
298
|
+
rng.shuffle(new_nodes)
|
|
299
|
+
d = dict(zip(nodes, new_nodes))
|
|
300
|
+
g2 = nx.relabel_nodes(g1, d)
|
|
301
|
+
if not g1.is_directed():
|
|
302
|
+
gm = iso.GraphMatcher(g1, g2)
|
|
303
|
+
else:
|
|
304
|
+
gm = iso.DiGraphMatcher(g1, g2)
|
|
305
|
+
assert gm.is_isomorphic()
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
def test_selfloop_mono():
|
|
309
|
+
# Simple test for graphs with selfloops
|
|
310
|
+
edges0 = [
|
|
311
|
+
(0, 1),
|
|
312
|
+
(0, 2),
|
|
313
|
+
(1, 2),
|
|
314
|
+
(1, 3),
|
|
315
|
+
(2, 4),
|
|
316
|
+
(3, 1),
|
|
317
|
+
(3, 2),
|
|
318
|
+
(4, 2),
|
|
319
|
+
(4, 5),
|
|
320
|
+
(5, 4),
|
|
321
|
+
]
|
|
322
|
+
edges = edges0 + [(2, 2)]
|
|
323
|
+
nodes = list(range(6))
|
|
324
|
+
|
|
325
|
+
rng = random.Random(42)
|
|
326
|
+
|
|
327
|
+
for g1 in [nx.Graph(), nx.DiGraph()]:
|
|
328
|
+
g1.add_edges_from(edges)
|
|
329
|
+
for _ in range(100):
|
|
330
|
+
new_nodes = list(nodes)
|
|
331
|
+
rng.shuffle(new_nodes)
|
|
332
|
+
d = dict(zip(nodes, new_nodes))
|
|
333
|
+
g2 = nx.relabel_nodes(g1, d)
|
|
334
|
+
g2.remove_edges_from(nx.selfloop_edges(g2))
|
|
335
|
+
if not g1.is_directed():
|
|
336
|
+
gm = iso.GraphMatcher(g2, g1)
|
|
337
|
+
else:
|
|
338
|
+
gm = iso.DiGraphMatcher(g2, g1)
|
|
339
|
+
assert not gm.subgraph_is_monomorphic()
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
def test_isomorphism_iter1():
|
|
343
|
+
# As described in:
|
|
344
|
+
# http://groups.google.com/group/networkx-discuss/browse_thread/thread/2ff65c67f5e3b99f/d674544ebea359bb?fwc=1
|
|
345
|
+
g1 = nx.DiGraph(["AB", "BC"])
|
|
346
|
+
g2 = nx.DiGraph(["YZ"])
|
|
347
|
+
g3 = nx.DiGraph(["ZY"])
|
|
348
|
+
gm12 = iso.DiGraphMatcher(g1, g2)
|
|
349
|
+
gm13 = iso.DiGraphMatcher(g1, g3)
|
|
350
|
+
x = list(gm12.subgraph_isomorphisms_iter())
|
|
351
|
+
y = list(gm13.subgraph_isomorphisms_iter())
|
|
352
|
+
assert {"A": "Y", "B": "Z"} in x
|
|
353
|
+
assert {"B": "Y", "C": "Z"} in x
|
|
354
|
+
assert {"A": "Z", "B": "Y"} in y
|
|
355
|
+
assert {"B": "Z", "C": "Y"} in y
|
|
356
|
+
assert len(x) == len(y)
|
|
357
|
+
assert len(x) == 2
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
def test_monomorphism_iter1():
|
|
361
|
+
g1 = nx.DiGraph(["AB", "BC", "CA"])
|
|
362
|
+
g2 = nx.DiGraph(["XY", "YZ"])
|
|
363
|
+
gm12 = iso.DiGraphMatcher(g1, g2)
|
|
364
|
+
x = list(gm12.subgraph_monomorphisms_iter())
|
|
365
|
+
assert {"A": "X", "B": "Y", "C": "Z"} in x
|
|
366
|
+
assert {"A": "Y", "B": "Z", "C": "X"} in x
|
|
367
|
+
assert {"A": "Z", "B": "X", "C": "Y"} in x
|
|
368
|
+
assert len(x) == 3
|
|
369
|
+
gm21 = iso.DiGraphMatcher(g2, g1)
|
|
370
|
+
# Check if StopIteration exception returns False
|
|
371
|
+
assert not gm21.subgraph_is_monomorphic()
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
def test_isomorphism_iter2():
|
|
375
|
+
# Path
|
|
376
|
+
for L in range(2, 10):
|
|
377
|
+
g1 = nx.path_graph(L)
|
|
378
|
+
gm = iso.GraphMatcher(g1, g1)
|
|
379
|
+
s = len(list(gm.isomorphisms_iter()))
|
|
380
|
+
assert s == 2
|
|
381
|
+
# Cycle
|
|
382
|
+
for L in range(3, 10):
|
|
383
|
+
g1 = nx.cycle_graph(L)
|
|
384
|
+
gm = iso.GraphMatcher(g1, g1)
|
|
385
|
+
s = len(list(gm.isomorphisms_iter()))
|
|
386
|
+
assert s == 2 * L
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def test_multiple():
|
|
390
|
+
# Verify that we can use the graph matcher multiple times
|
|
391
|
+
edges = [("A", "B"), ("B", "A"), ("B", "C")]
|
|
392
|
+
for g1, g2 in [(nx.Graph(), nx.Graph()), (nx.DiGraph(), nx.DiGraph())]:
|
|
393
|
+
g1.add_edges_from(edges)
|
|
394
|
+
g2.add_edges_from(edges)
|
|
395
|
+
g3 = nx.subgraph(g2, ["A", "B"])
|
|
396
|
+
if not g1.is_directed():
|
|
397
|
+
gmA = iso.GraphMatcher(g1, g2)
|
|
398
|
+
gmB = iso.GraphMatcher(g1, g3)
|
|
399
|
+
else:
|
|
400
|
+
gmA = iso.DiGraphMatcher(g1, g2)
|
|
401
|
+
gmB = iso.DiGraphMatcher(g1, g3)
|
|
402
|
+
assert gmA.is_isomorphic()
|
|
403
|
+
|
|
404
|
+
g2.remove_node("C")
|
|
405
|
+
if not g1.is_directed():
|
|
406
|
+
gmA = iso.GraphMatcher(g1, g2)
|
|
407
|
+
else:
|
|
408
|
+
gmA = iso.DiGraphMatcher(g1, g2)
|
|
409
|
+
assert gmA.subgraph_is_isomorphic()
|
|
410
|
+
assert gmB.subgraph_is_isomorphic()
|
|
411
|
+
assert gmA.subgraph_is_monomorphic()
|
|
412
|
+
assert gmB.subgraph_is_monomorphic()
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
def test_noncomparable_nodes():
|
|
416
|
+
node1 = object()
|
|
417
|
+
node2 = object()
|
|
418
|
+
node3 = object()
|
|
419
|
+
|
|
420
|
+
# Graph
|
|
421
|
+
G = nx.path_graph([node1, node2, node3])
|
|
422
|
+
gm = iso.GraphMatcher(G, G)
|
|
423
|
+
assert gm.is_isomorphic()
|
|
424
|
+
assert gm.subgraph_is_monomorphic()
|
|
425
|
+
|
|
426
|
+
# DiGraph
|
|
427
|
+
G = nx.path_graph([node1, node2, node3], create_using=nx.DiGraph)
|
|
428
|
+
H = nx.path_graph([node3, node2, node1], create_using=nx.DiGraph)
|
|
429
|
+
dgm = iso.DiGraphMatcher(G, H)
|
|
430
|
+
assert dgm.is_isomorphic()
|
|
431
|
+
assert dgm.subgraph_is_monomorphic()
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
def test_monomorphism_edge_match():
|
|
435
|
+
G = nx.DiGraph()
|
|
436
|
+
G.add_node(1)
|
|
437
|
+
G.add_node(2)
|
|
438
|
+
G.add_edge(1, 2, label="A")
|
|
439
|
+
G.add_edge(2, 1, label="B")
|
|
440
|
+
G.add_edge(2, 2, label="C")
|
|
441
|
+
|
|
442
|
+
SG = nx.DiGraph()
|
|
443
|
+
SG.add_node(5)
|
|
444
|
+
SG.add_node(6)
|
|
445
|
+
SG.add_edge(5, 6, label="A")
|
|
446
|
+
|
|
447
|
+
gm = iso.DiGraphMatcher(G, SG, edge_match=iso.categorical_edge_match("label", None))
|
|
448
|
+
assert gm.subgraph_is_monomorphic()
|
|
449
|
+
G.edges[1, 2]["label"] = None
|
|
450
|
+
assert not gm.subgraph_is_monomorphic()
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
@pytest.mark.parametrize(
|
|
454
|
+
("e1", "e2", "isomorphic", "subgraph_is_isomorphic"),
|
|
455
|
+
[
|
|
456
|
+
([(0, 1), (0, 2)], [(0, 1), (0, 2), (1, 2)], False, False),
|
|
457
|
+
([(0, 1), (0, 2)], [(0, 1), (0, 2), (2, 1)], False, False),
|
|
458
|
+
([(0, 1), (1, 2)], [(0, 1), (1, 2), (2, 0)], False, False),
|
|
459
|
+
([(0, 1)], [(0, 1), (1, 2), (2, 0)], False, False),
|
|
460
|
+
([(0, 1), (1, 2), (2, 0)], [(0, 1)], False, True),
|
|
461
|
+
([(0, 1), (1, 2)], [(0, 1), (2, 0), (2, 1)], False, False),
|
|
462
|
+
([(0, 1), (0, 2), (1, 2)], [(0, 1), (0, 2), (2, 1)], True, True),
|
|
463
|
+
([(0, 1), (0, 2), (1, 2)], [(0, 1), (1, 2), (2, 0)], False, False),
|
|
464
|
+
(
|
|
465
|
+
[(0, 0), (0, 1), (1, 2), (2, 1)],
|
|
466
|
+
[(0, 1), (1, 0), (1, 2), (2, 0)],
|
|
467
|
+
False,
|
|
468
|
+
False,
|
|
469
|
+
),
|
|
470
|
+
(
|
|
471
|
+
[(0, 0), (1, 0), (1, 2), (2, 1)],
|
|
472
|
+
[(0, 1), (0, 2), (1, 0), (1, 2)],
|
|
473
|
+
False,
|
|
474
|
+
False,
|
|
475
|
+
),
|
|
476
|
+
(
|
|
477
|
+
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1), (2, 2)],
|
|
478
|
+
[(0, 0), (0, 1), (0, 2), (1, 1), (1, 2), (2, 0), (2, 1), (2, 2)],
|
|
479
|
+
False,
|
|
480
|
+
False,
|
|
481
|
+
),
|
|
482
|
+
],
|
|
483
|
+
)
|
|
484
|
+
def test_three_node(e1, e2, isomorphic, subgraph_is_isomorphic):
|
|
485
|
+
"""Test some edge cases distilled from arbitrary search of the input space."""
|
|
486
|
+
G1 = nx.DiGraph(e1)
|
|
487
|
+
G2 = nx.DiGraph(e2)
|
|
488
|
+
gm = iso.DiGraphMatcher(G1, G2)
|
|
489
|
+
assert gm.is_isomorphic() == isomorphic
|
|
490
|
+
assert gm.subgraph_is_isomorphic() == subgraph_is_isomorphic
|
package/runtime/python/okstra_vendor/networkx/algorithms/isomorphism/tests/test_match_helpers.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from operator import eq
|
|
2
|
+
|
|
3
|
+
import networkx as nx
|
|
4
|
+
from networkx.algorithms import isomorphism as iso
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def test_categorical_node_match():
|
|
8
|
+
nm = iso.categorical_node_match(["x", "y", "z"], [None] * 3)
|
|
9
|
+
assert nm({"x": 1, "y": 2, "z": 3}, {"x": 1, "y": 2, "z": 3})
|
|
10
|
+
assert not nm({"x": 1, "y": 2, "z": 2}, {"x": 1, "y": 2, "z": 1})
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TestGenericMultiEdgeMatch:
|
|
14
|
+
def setup_method(self):
|
|
15
|
+
self.G1 = nx.MultiDiGraph()
|
|
16
|
+
self.G2 = nx.MultiDiGraph()
|
|
17
|
+
self.G3 = nx.MultiDiGraph()
|
|
18
|
+
self.G4 = nx.MultiDiGraph()
|
|
19
|
+
attr_dict1 = {"id": "edge1", "minFlow": 0, "maxFlow": 10}
|
|
20
|
+
attr_dict2 = {"id": "edge2", "minFlow": -3, "maxFlow": 7}
|
|
21
|
+
attr_dict3 = {"id": "edge3", "minFlow": 13, "maxFlow": 117}
|
|
22
|
+
attr_dict4 = {"id": "edge4", "minFlow": 13, "maxFlow": 117}
|
|
23
|
+
attr_dict5 = {"id": "edge5", "minFlow": 8, "maxFlow": 12}
|
|
24
|
+
attr_dict6 = {"id": "edge6", "minFlow": 8, "maxFlow": 12}
|
|
25
|
+
for attr_dict in [
|
|
26
|
+
attr_dict1,
|
|
27
|
+
attr_dict2,
|
|
28
|
+
attr_dict3,
|
|
29
|
+
attr_dict4,
|
|
30
|
+
attr_dict5,
|
|
31
|
+
attr_dict6,
|
|
32
|
+
]:
|
|
33
|
+
self.G1.add_edge(1, 2, **attr_dict)
|
|
34
|
+
for attr_dict in [
|
|
35
|
+
attr_dict5,
|
|
36
|
+
attr_dict3,
|
|
37
|
+
attr_dict6,
|
|
38
|
+
attr_dict1,
|
|
39
|
+
attr_dict4,
|
|
40
|
+
attr_dict2,
|
|
41
|
+
]:
|
|
42
|
+
self.G2.add_edge(2, 3, **attr_dict)
|
|
43
|
+
for attr_dict in [attr_dict3, attr_dict5]:
|
|
44
|
+
self.G3.add_edge(3, 4, **attr_dict)
|
|
45
|
+
for attr_dict in [attr_dict6, attr_dict4]:
|
|
46
|
+
self.G4.add_edge(4, 5, **attr_dict)
|
|
47
|
+
|
|
48
|
+
def test_generic_multiedge_match(self):
|
|
49
|
+
full_match = iso.generic_multiedge_match(
|
|
50
|
+
["id", "flowMin", "flowMax"], [None] * 3, [eq] * 3
|
|
51
|
+
)
|
|
52
|
+
flow_match = iso.generic_multiedge_match(
|
|
53
|
+
["flowMin", "flowMax"], [None] * 2, [eq] * 2
|
|
54
|
+
)
|
|
55
|
+
min_flow_match = iso.generic_multiedge_match("flowMin", None, eq)
|
|
56
|
+
id_match = iso.generic_multiedge_match("id", None, eq)
|
|
57
|
+
assert flow_match(self.G1[1][2], self.G2[2][3])
|
|
58
|
+
assert min_flow_match(self.G1[1][2], self.G2[2][3])
|
|
59
|
+
assert id_match(self.G1[1][2], self.G2[2][3])
|
|
60
|
+
assert full_match(self.G1[1][2], self.G2[2][3])
|
|
61
|
+
assert flow_match(self.G3[3][4], self.G4[4][5])
|
|
62
|
+
assert min_flow_match(self.G3[3][4], self.G4[4][5])
|
|
63
|
+
assert not id_match(self.G3[3][4], self.G4[4][5])
|
|
64
|
+
assert not full_match(self.G3[3][4], self.G4[4][5])
|