mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-12-04 18:30:17 +00:00
resolved pre commit checks for test_edmonds_blossom_algorithm.py and edmonds_blossom_algorithm.py
This commit is contained in:
parent
b8571bcffc
commit
4154353078
|
@ -241,8 +241,9 @@ class BlossomData:
|
||||||
BlossomData class with reduced parameters.
|
BlossomData class with reduced parameters.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, aux_data: BlossomAuxData, vertex_u: int,
|
def __init__(
|
||||||
vertex_v: int, lca: int) -> None:
|
self, aux_data: BlossomAuxData, vertex_u: int, vertex_v: int, lca: int
|
||||||
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Initialize BlossomData with auxiliary data, two vertices,
|
Initialize BlossomData with auxiliary data, two vertices,
|
||||||
and the lowest common ancestor.
|
and the lowest common ancestor.
|
||||||
|
@ -256,4 +257,3 @@ class BlossomData:
|
||||||
self.vertex_u = vertex_u
|
self.vertex_u = vertex_u
|
||||||
self.vertex_v = vertex_v
|
self.vertex_v = vertex_v
|
||||||
self.lca = lca
|
self.lca = lca
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ from graphs.edmonds_blossom_algorithm import (
|
||||||
|
|
||||||
|
|
||||||
class TestEdmondsBlossomAlgorithm(unittest.TestCase):
|
class TestEdmondsBlossomAlgorithm(unittest.TestCase):
|
||||||
|
|
||||||
def test_maximum_matching(self):
|
def test_maximum_matching(self):
|
||||||
# Test case: Basic matching in a simple graph
|
# Test case: Basic matching in a simple graph
|
||||||
edges = [(0, 1), (1, 2), (2, 3)]
|
edges = [(0, 1), (1, 2), (2, 3)]
|
||||||
|
@ -68,5 +67,5 @@ class TestEdmondsBlossomAlgorithm(unittest.TestCase):
|
||||||
assert aux_data.in_queue[1]
|
assert aux_data.in_queue[1]
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user