Ejemplo n.º 1
0
 def test_WeakVerticesThreeWeekVertices(self):
     graph = SimpleGraph(5)
     self.addVertexes(graph, [0, 1, 2])
     result = graph.WeakVertices()
     self.assertTrue(
         result == [graph.vertex[0], graph.vertex[1], graph.vertex[2]],
         result)
Ejemplo n.º 2
0
 def test_WeakVerticesFiveVerticesWithTriangle(self):
     graph = SimpleGraph(5)
     self.addVertexes(graph, [0, 1, 2, 3, 4])
     graph.AddEdge(1, 2)
     graph.AddEdge(2, 4)
     graph.AddEdge(4, 1)
     result = graph.WeakVertices()
     self.assertTrue(result == [graph.vertex[0], graph.vertex[3]], result)
Ejemplo n.º 3
0
 def test_WeakVerticesThreeStrongVertices(self):
     graph = SimpleGraph(5)
     self.addVertexes(graph, [0, 1, 2])
     graph.AddEdge(0, 1)
     graph.AddEdge(1, 2)
     graph.AddEdge(2, 0)
     result = graph.WeakVertices()
     self.assertTrue(result == [], result)
Ejemplo n.º 4
0
 def test_WeakVerticesFiveVerticesWithTwoTriangles(self):
     graph = SimpleGraph(5)
     self.addVertexes(graph, [0, 1, 2, 3, 4])
     graph.AddEdge(0, 1)
     graph.AddEdge(1, 2)
     graph.AddEdge(2, 0)
     graph.AddEdge(0, 3)
     graph.AddEdge(0, 4)
     graph.AddEdge(3, 4)
     result = graph.WeakVertices()
     self.assertTrue(result == [], result)
Ejemplo n.º 5
0
 def test_WeakVerticesSixVerticesWithOneWeekVertex(self):
     graph = SimpleGraph(6)
     self.addVertexes(graph, [0, 1, 2, 3, 4, 5])
     graph.AddEdge(0, 1)
     graph.AddEdge(1, 2)
     graph.AddEdge(2, 0)
     graph.AddEdge(0, 3)
     graph.AddEdge(0, 4)
     graph.AddEdge(3, 4)
     graph.AddEdge(1, 5)
     result = graph.WeakVertices()
     self.assertTrue(result == [graph.vertex[5]], result)
Ejemplo n.º 6
0
 def test_WeakVerticesOneWeekVertex(self):
     graph = SimpleGraph(5)
     self.addVertexes(graph, [0])
     result = graph.WeakVertices()
     self.assertTrue(result == [graph.vertex[0]], result)
Ejemplo n.º 7
0
 def test_WeakVerticesEmpty(self):
     graph = SimpleGraph(5)
     self.addVertexes(graph, [])
     result = graph.WeakVertices()
     self.assertTrue(result == [], result)