alonso 0.0.8__py3-none-any.whl → 0.1.0__py3-none-any.whl

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.
alonso/app.py CHANGED
@@ -82,7 +82,7 @@ def main():
82
82
  helper.add_argument('-c', '--count', action='store_true', help='calculate the size of the vertex cover')
83
83
  helper.add_argument('-v', '--verbose', action='store_true', help='anable verbose output')
84
84
  helper.add_argument('-l', '--log', action='store_true', help='enable file logging')
85
- helper.add_argument('--version', action='version', version='%(prog)s 0.0.8')
85
+ helper.add_argument('--version', action='version', version='%(prog)s 0.1.0')
86
86
 
87
87
  # Initialize the parameters
88
88
  args = helper.parse_args()
alonso/batch.py CHANGED
@@ -36,7 +36,7 @@ def main():
36
36
  helper.add_argument('-c', '--count', action='store_true', help='calculate the size of the vertex cover')
37
37
  helper.add_argument('-v', '--verbose', action='store_true', help='anable verbose output')
38
38
  helper.add_argument('-l', '--log', action='store_true', help='enable file logging')
39
- helper.add_argument('--version', action='version', version='%(prog)s 0.0.8')
39
+ helper.add_argument('--version', action='version', version='%(prog)s 0.1.0')
40
40
 
41
41
 
42
42
  # Initialize the parameters
alonso/partition.py CHANGED
@@ -1,7 +1,8 @@
1
1
  from collections import defaultdict
2
2
  import networkx as nx
3
3
  from typing import Set, Tuple, List
4
- import mendive.algorithm as algo
4
+ import mendive.algorithm as claws
5
+ import aegypti.algorithm as triangles
5
6
  class ClawFreePartitioner:
6
7
  """
7
8
  Implements a polynomial-time algorithm to partition graph edges into two sets
@@ -57,32 +58,23 @@ class ClawFreePartitioner:
57
58
  True if adding the edge would create a claw, False otherwise
58
59
  """
59
60
  # Build adjacency list for current partition
60
- adj = defaultdict(set)
61
+ G = nx.Graph()
61
62
  for u, v in edges_in_partition:
62
- adj[u].add(v)
63
- adj[v].add(u)
63
+ G.add_edge(u, v)
64
64
 
65
65
  # Add the new edge temporarily
66
66
  u, v = new_edge
67
- adj[u].add(v)
68
- adj[v].add(u)
69
-
67
+ G.add_edge(u, v)
68
+ H = nx.complement(G)
70
69
  # Check if any vertex now forms a claw
71
70
  for vertex in [u, v]:
72
- neighbors = list(adj[vertex])
71
+ neighbors = list(G.neighbors(vertex))
73
72
  if len(neighbors) >= 3:
74
73
  # Check all combinations of 3 neighbors
75
-
76
- for i in range(len(neighbors)):
77
- for j in range(i + 1, len(neighbors)):
78
- for k in range(j + 1, len(neighbors)):
79
- n1, n2, n3 = neighbors[i], neighbors[j], neighbors[k]
80
- # Check if these 3 neighbors are not connected to each other
81
- # (which would make vertex the center of a claw)
82
- if (n1 not in adj[n2] and n2 not in adj[n1] and
83
- n1 not in adj[n3] and n3 not in adj[n1] and
84
- n2 not in adj[n3] and n3 not in adj[n2]):
85
- return True
74
+ subgraph = H.subgraph(neighbors)
75
+ triangle = triangles.find_triangle_coordinates(subgraph, first_triangle=True)
76
+ if triangle is not None:
77
+ return True
86
78
 
87
79
  return False
88
80
 
@@ -162,7 +154,7 @@ class ClawFreePartitioner:
162
154
  # Build adjacency list
163
155
  G = nx.Graph()
164
156
  G.add_edges_from(edge_set)
165
- claw = algo.find_claw_coordinates(G, first_claw=True)
157
+ claw = claws.find_claw_coordinates(G, first_claw=True)
166
158
  if claw is None:
167
159
  return True
168
160
  else:
alonso/test.py CHANGED
@@ -34,7 +34,7 @@ def main():
34
34
  helper.add_argument('-w', '--write', action='store_true', help='write the generated random matrix to a file in the current directory')
35
35
  helper.add_argument('-v', '--verbose', action='store_true', help='anable verbose output')
36
36
  helper.add_argument('-l', '--log', action='store_true', help='enable file logging')
37
- helper.add_argument('--version', action='version', version='%(prog)s 0.0.8')
37
+ helper.add_argument('--version', action='version', version='%(prog)s 0.1.0')
38
38
 
39
39
  # Initialize the parameters
40
40
  args = helper.parse_args()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alonso
3
- Version: 0.0.8
3
+ Version: 0.1.0
4
4
  Summary: Compute an Approximate Vertex Cover for undirected graph encoded in DIMACS format.
5
5
  Home-page: https://github.com/frankvegadelgado/alonso
6
6
  Author: Frank Vega
@@ -12,17 +12,17 @@ Classifier: Topic :: Scientific/Engineering
12
12
  Classifier: Topic :: Software Development
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Environment :: Console
17
17
  Classifier: Intended Audience :: Developers
18
18
  Classifier: Intended Audience :: Education
19
19
  Classifier: Intended Audience :: Information Technology
20
20
  Classifier: Intended Audience :: Science/Research
21
21
  Classifier: Natural Language :: English
22
- Requires-Python: >=3.10
22
+ Requires-Python: >=3.12
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
- Requires-Dist: mendive>=0.0.5
25
+ Requires-Dist: mendive>=0.0.7
26
26
  Dynamic: author
27
27
  Dynamic: author-email
28
28
  Dynamic: classifier
@@ -117,7 +117,7 @@ Vertex Cover Found `3, 4, 5`: Nodes `3`, `4`, and `5` constitute an optimal solu
117
117
 
118
118
  ## Prerequisites
119
119
 
120
- - Python ≥ 3.10
120
+ - Python ≥ 3.12
121
121
 
122
122
  ## Installation
123
123
 
@@ -0,0 +1,17 @@
1
+ alonso/__init__.py,sha256=xFbWJ7kskxYZCWD3QWtJ6d9uGnDlqhJyFJDCVuqG7hE,207
2
+ alonso/algorithm.py,sha256=QqSdBTIPtLxAVoCtCmlTTlflJafjsbA00AKMRehKoOE,5241
3
+ alonso/app.py,sha256=pJvRZcUM_OlJvTFK1Roa7ZHoYRgTeWPK5rrynPv8itU,4320
4
+ alonso/applogger.py,sha256=fQBo51-TboX1DBqfSxX2P2eKJ5CcyiCq_IVlJTHjxAE,2624
5
+ alonso/batch.py,sha256=WCGb0GjW0G8b_gRjTZYFl4oWDD6Jd-4CIN3O2AcFnHs,2305
6
+ alonso/merge.py,sha256=dWhF9t_2bFp4HT1NCzjhrSlhm8CkJQ4pwBHOhHSkezQ,4257
7
+ alonso/parser.py,sha256=Ib4TnWdkQb6A6FA3HHEjZDBb7uD0v9Gabwewqfu4XpQ,2549
8
+ alonso/partition.py,sha256=i6Q4rKN6ftETncaEyUVXJCIdRaNpGacrDmdd8iQETO4,7643
9
+ alonso/stable.py,sha256=IwINwjd3F7dfoISXlWsNWRkVJzItEojgMyNwzMM7nYc,6577
10
+ alonso/test.py,sha256=nAbAqooCQUJDt6S5J1yV-PZDMoMosOqkgQEyqR37nOw,5472
11
+ alonso/utils.py,sha256=RmctLB8oDtjf0wKcKFaRvXiRgmtegqfbB1HFFzlpsvE,7674
12
+ alonso-0.1.0.dist-info/licenses/LICENSE,sha256=nUDh1nfa7rfEv1HocpoqPu0JaFnZKpIVh9eM0MgozpM,1067
13
+ alonso-0.1.0.dist-info/METADATA,sha256=y3BB3PH9WZ8K0v9knuby2qhePsKhfmqdaDZPDSO7ZRw,9293
14
+ alonso-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ alonso-0.1.0.dist-info/entry_points.txt,sha256=JSod2CWtklhiaOFW3masqrgqhXIpVRsbIiprSmS1P7g,98
16
+ alonso-0.1.0.dist-info/top_level.txt,sha256=rOo7SlpYGdic6g55rHDus2d5N2t74H9qamX4yi6z5vw,7
17
+ alonso-0.1.0.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- alonso/__init__.py,sha256=xFbWJ7kskxYZCWD3QWtJ6d9uGnDlqhJyFJDCVuqG7hE,207
2
- alonso/algorithm.py,sha256=QqSdBTIPtLxAVoCtCmlTTlflJafjsbA00AKMRehKoOE,5241
3
- alonso/app.py,sha256=W4lRbazSIy5zqNZUZmEgQ-7qGlQnczw2AwV6_6EDlcA,4320
4
- alonso/applogger.py,sha256=fQBo51-TboX1DBqfSxX2P2eKJ5CcyiCq_IVlJTHjxAE,2624
5
- alonso/batch.py,sha256=6Q9m_H_zj-eiG_qd7As856C--pzBFckpX8_N3zLT7qc,2305
6
- alonso/merge.py,sha256=dWhF9t_2bFp4HT1NCzjhrSlhm8CkJQ4pwBHOhHSkezQ,4257
7
- alonso/parser.py,sha256=Ib4TnWdkQb6A6FA3HHEjZDBb7uD0v9Gabwewqfu4XpQ,2549
8
- alonso/partition.py,sha256=iDtuIkLyBTf8Cg-nceYDgLlWWQ2mLGrm-J3fmnz0j5I,8114
9
- alonso/stable.py,sha256=IwINwjd3F7dfoISXlWsNWRkVJzItEojgMyNwzMM7nYc,6577
10
- alonso/test.py,sha256=f-L8SlJfRlnbu9_EV-8m8b7X9eobBxH3VX2JN9eU0U8,5472
11
- alonso/utils.py,sha256=RmctLB8oDtjf0wKcKFaRvXiRgmtegqfbB1HFFzlpsvE,7674
12
- alonso-0.0.8.dist-info/licenses/LICENSE,sha256=nUDh1nfa7rfEv1HocpoqPu0JaFnZKpIVh9eM0MgozpM,1067
13
- alonso-0.0.8.dist-info/METADATA,sha256=LdX28VgfNlpHcpkq4Y1xM4UuRCv7jTwX2hN1ca4FEos,9293
14
- alonso-0.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- alonso-0.0.8.dist-info/entry_points.txt,sha256=JSod2CWtklhiaOFW3masqrgqhXIpVRsbIiprSmS1P7g,98
16
- alonso-0.0.8.dist-info/top_level.txt,sha256=rOo7SlpYGdic6g55rHDus2d5N2t74H9qamX4yi6z5vw,7
17
- alonso-0.0.8.dist-info/RECORD,,
File without changes