put-asunder 0.2.3__tar.gz → 0.2.4__tar.gz

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.
Files changed (60) hide show
  1. {put_asunder-0.2.3/put_asunder.egg-info → put_asunder-0.2.4}/PKG-INFO +10 -3
  2. {put_asunder-0.2.3 → put_asunder-0.2.4}/README.md +9 -2
  3. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/__init__.py +1 -1
  4. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/community.py +9 -5
  5. {put_asunder-0.2.3 → put_asunder-0.2.4/put_asunder.egg-info}/PKG-INFO +10 -3
  6. {put_asunder-0.2.3 → put_asunder-0.2.4}/pyproject.toml +1 -1
  7. {put_asunder-0.2.3 → put_asunder-0.2.4}/LICENSE +0 -0
  8. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/__init__.py +0 -0
  9. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/RCCS.py +0 -0
  10. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/__init__.py +0 -0
  11. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/core_periphery.py +0 -0
  12. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/louvain_modified.py +0 -0
  13. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/modular_VFD.py +0 -0
  14. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/signed_louvain/__init__.py +0 -0
  15. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/signed_louvain/community_detection.py +0 -0
  16. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/signed_louvain/util.py +0 -0
  17. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/algorithms/spectral.py +0 -0
  18. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/branch_and_price/__init__.py +0 -0
  19. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/branch_and_price/branching_tree.py +0 -0
  20. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/branch_and_price/symmetry_detection.py +0 -0
  21. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/column_generation/__init__.py +0 -0
  22. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/column_generation/decomposition.py +0 -0
  23. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/column_generation/master.py +0 -0
  24. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/column_generation/subproblem.py +0 -0
  25. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/evaluation/__init__.py +0 -0
  26. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/evaluation/metrics.py +0 -0
  27. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/legacy/__init__.py +0 -0
  28. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/legacy/notebook_compat.py +0 -0
  29. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/utils/__init__.py +0 -0
  30. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/utils/graph.py +0 -0
  31. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/utils/partition_generation.py +0 -0
  32. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/visualization/__init__.py +0 -0
  33. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/visualization/graphs.py +0 -0
  34. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/base/visualization/matrices.py +0 -0
  35. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/config.py +0 -0
  36. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/__init__.py +0 -0
  37. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/algorithms/VFD.py +0 -0
  38. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/algorithms/__init__.py +0 -0
  39. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/column_generation/LB.py +0 -0
  40. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/column_generation/__init__.py +0 -0
  41. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/column_generation/master.py +0 -0
  42. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/utils/__init__.py +0 -0
  43. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/load_balancing/utils/partition_generation.py +0 -0
  44. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/__init__.py +0 -0
  45. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/algorithms/__init__.py +0 -0
  46. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/algorithms/core_periphery.py +0 -0
  47. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/algorithms/refinement.py +0 -0
  48. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/case_studies/__init__.py +0 -0
  49. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/case_studies/circle_cutting.py +0 -0
  50. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/case_studies/cpcong.py +0 -0
  51. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/case_studies/runner.py +0 -0
  52. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/nlbnp/workflow.py +0 -0
  53. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/orchestrator.py +0 -0
  54. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/solvers.py +0 -0
  55. {put_asunder-0.2.3 → put_asunder-0.2.4}/asunder/types.py +0 -0
  56. {put_asunder-0.2.3 → put_asunder-0.2.4}/put_asunder.egg-info/SOURCES.txt +0 -0
  57. {put_asunder-0.2.3 → put_asunder-0.2.4}/put_asunder.egg-info/dependency_links.txt +0 -0
  58. {put_asunder-0.2.3 → put_asunder-0.2.4}/put_asunder.egg-info/requires.txt +0 -0
  59. {put_asunder-0.2.3 → put_asunder-0.2.4}/put_asunder.egg-info/top_level.txt +0 -0
  60. {put_asunder-0.2.3 → put_asunder-0.2.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: put-asunder
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Asunder: Constrained Network Structure Detection on Undirected Graphs.
5
5
  Author-email: Allman Group <allmanaa@umich.edu>, Fortune Adekogbe <fortunea@umich.edu>
6
6
  License-Expression: BSD-3-Clause
@@ -65,13 +65,20 @@ Base install:
65
65
  python3 -m pip install put-asunder
66
66
  ```
67
67
 
68
- Optional extras:
68
+ Graph extras (supports ``leidenalg`` and ``igraph`` algorithms):
69
+
70
+ ```bash
71
+ python3 -m pip install "put-asunder[graph]"
72
+ ```
73
+
74
+
75
+ Graph and visualization (``matplotlib`` and ``seaborn``) extras:
69
76
 
70
77
  ```bash
71
78
  python3 -m pip install "put-asunder[graph,viz]"
72
79
  ```
73
80
 
74
- Legacy heuristics (best-effort on Python 3.13 and 3.14):
81
+ Legacy core periphery heuristics (best-effort on Python 3.13 and 3.14):
75
82
 
76
83
  ```bash
77
84
  python3 -m pip install "put-asunder[legacy]"
@@ -16,13 +16,20 @@ Base install:
16
16
  python3 -m pip install put-asunder
17
17
  ```
18
18
 
19
- Optional extras:
19
+ Graph extras (supports ``leidenalg`` and ``igraph`` algorithms):
20
+
21
+ ```bash
22
+ python3 -m pip install "put-asunder[graph]"
23
+ ```
24
+
25
+
26
+ Graph and visualization (``matplotlib`` and ``seaborn``) extras:
20
27
 
21
28
  ```bash
22
29
  python3 -m pip install "put-asunder[graph,viz]"
23
30
  ```
24
31
 
25
- Legacy heuristics (best-effort on Python 3.13 and 3.14):
32
+ Legacy core periphery heuristics (best-effort on Python 3.13 and 3.14):
26
33
 
27
34
  ```bash
28
35
  python3 -m pip install "put-asunder[legacy]"
@@ -7,7 +7,7 @@ from asunder.orchestrator import CSDDecomposition, run_csd_decomposition
7
7
  from asunder.solvers import create_solver
8
8
  from asunder.types import DecompositionResult, IterationRecord
9
9
 
10
- __version__ = "0.2.3"
10
+ __version__ = "0.2.4"
11
11
 
12
12
  def run_evaluation(*args, **kwargs):
13
13
  """
@@ -413,6 +413,7 @@ def run_leidenalg(modified_A, algo='leiden', seed=42, resolution=1, verbose=Fals
413
413
  seed=seed,
414
414
  weights='weight'
415
415
  )
416
+ metric = partition.quality() / modified_A.sum()
416
417
  elif algo == "signed_leiden":
417
418
  # uses multiplex community detection to handle negative weights
418
419
  g_pos = ig_graph.subgraph_edges(ig_graph.es.select(weight_gt=0), delete_vertices=False)
@@ -427,9 +428,13 @@ def run_leidenalg(modified_A, algo='leiden', seed=42, resolution=1, verbose=Fals
427
428
  resolution_parameter=resolution,
428
429
  seed=seed
429
430
  )
431
+ partition = layer_partitions[0]
432
+
430
433
  part_pos = la.RBConfigurationVertexPartition(g_pos, weights='weight', initial_membership=layer_partitions[0], resolution_parameter=resolution)
431
434
  part_neg = la.RBConfigurationVertexPartition(g_neg, weights='weight', initial_membership=layer_partitions[0], resolution_parameter=resolution)
432
- partition = layer_partitions[0]
435
+ m_pos = sum(g_pos.es['weight'])
436
+ m_neg = sum(g_neg.es['weight'])
437
+ metric = (1 * part_pos.quality() / m_pos) + (-1 * part_neg.quality() / m_neg)
433
438
  elif algo == "cpm_leiden":
434
439
  # Constant Potts Model (CPM). Resolution-limit free and handles negative weights.
435
440
  partition = la.find_partition(
@@ -439,6 +444,7 @@ def run_leidenalg(modified_A, algo='leiden', seed=42, resolution=1, verbose=Fals
439
444
  seed=seed,
440
445
  weights='weight'
441
446
  )
447
+ metric = partition.quality()
442
448
  elif algo == "surprise_leiden":
443
449
  partition = la.find_partition(
444
450
  ig_graph,
@@ -446,6 +452,7 @@ def run_leidenalg(modified_A, algo='leiden', seed=42, resolution=1, verbose=Fals
446
452
  seed=seed,
447
453
  weights='weight'
448
454
  )
455
+ metric = partition.quality()
449
456
  elif algo == "signed_surprise_leiden":
450
457
  # uses multiplex community detection to handle negative weights
451
458
  g_pos = ig_graph.subgraph_edges(ig_graph.es.select(weight_gt=0), delete_vertices=False)
@@ -462,6 +469,7 @@ def run_leidenalg(modified_A, algo='leiden', seed=42, resolution=1, verbose=Fals
462
469
  part_pos = la.SurpriseVertexPartition(g_pos, weights='weight', initial_membership=layer_partitions[0])
463
470
  part_neg = la.SurpriseVertexPartition(g_neg, weights='weight', initial_membership=layer_partitions[0])
464
471
  partition = layer_partitions[0]
472
+ metric = (1 * part_pos.quality()) + (-1 * part_neg.quality())
465
473
  else:
466
474
  raise(NotImplementedError("Invalid Leidenalg Algorithm."))
467
475
 
@@ -470,10 +478,6 @@ def run_leidenalg(modified_A, algo='leiden', seed=42, resolution=1, verbose=Fals
470
478
  partition if algo.startswith("signed") else partition.membership
471
479
  )
472
480
  zii = np.equal.outer(oneD_z, oneD_z).astype(int)
473
- if algo.startswith("signed"):
474
- metric = (1 * part_pos.quality()) + (-1 * part_neg.quality())
475
- else:
476
- metric = partition.quality()
477
481
  return zii, metric
478
482
 
479
483
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: put-asunder
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Asunder: Constrained Network Structure Detection on Undirected Graphs.
5
5
  Author-email: Allman Group <allmanaa@umich.edu>, Fortune Adekogbe <fortunea@umich.edu>
6
6
  License-Expression: BSD-3-Clause
@@ -65,13 +65,20 @@ Base install:
65
65
  python3 -m pip install put-asunder
66
66
  ```
67
67
 
68
- Optional extras:
68
+ Graph extras (supports ``leidenalg`` and ``igraph`` algorithms):
69
+
70
+ ```bash
71
+ python3 -m pip install "put-asunder[graph]"
72
+ ```
73
+
74
+
75
+ Graph and visualization (``matplotlib`` and ``seaborn``) extras:
69
76
 
70
77
  ```bash
71
78
  python3 -m pip install "put-asunder[graph,viz]"
72
79
  ```
73
80
 
74
- Legacy heuristics (best-effort on Python 3.13 and 3.14):
81
+ Legacy core periphery heuristics (best-effort on Python 3.13 and 3.14):
75
82
 
76
83
  ```bash
77
84
  python3 -m pip install "put-asunder[legacy]"
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "put-asunder"
7
- version = "0.2.3"
7
+ version = "0.2.4"
8
8
  description = "Asunder: Constrained Network Structure Detection on Undirected Graphs."
9
9
  readme = "README.md"
10
10
  license = "BSD-3-Clause"
File without changes
File without changes