-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
44 lines (39 loc) · 862 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# coding=utf-8
from header import *
gph = Graph(9)
gph.AddBiEdge(0, 2, 1)
gph.AddBiEdge(1, 2, 5)
gph.AddBiEdge(1, 3, 7)
gph.AddBiEdge(1, 4, 9)
gph.AddBiEdge(3, 2, 2)
gph.AddBiEdge(3, 5, 4)
gph.AddBiEdge(4, 5, 6)
gph.AddBiEdge(4, 6, 3)
gph.AddBiEdge(5, 7, 1)
gph.AddBiEdge(6, 7, 7)
gph.AddBiEdge(7, 8, 17)
print " "
print "Tester de Dijkstra: "
Dijkstra(gph, 1)
print " "
print "Tester de Prim: "
Prim_metodo(gph)
print " "
print "Tester de Kruskal: "
print kruskal(graph)
print " "
print "Tester de busqueda por anchura: "
print busqueda_por_anchura(gph)
print " "
print "Tester de busqueda por profundidad: "
print busqueda_por_profundidad(gph)
print " "
print "¿El camino existe?: "
print " "
print PathExist(gph, 1, 5)
print " "
print "Puntos de articulación: "
print isConnected(gph)
ShortestPath(gph, 1)
print " "