Commit 7690626a authored by Benoit GAUZERE's avatar Benoit GAUZERE

Add of np.inf as infinite value instead of 1000

parent ec02e891
......@@ -8,7 +8,7 @@ def computeBipartiteCostMatrix(G1, G2, cf=ConstantCostFunction(1, 3, 1, 3)):
n = G1.number_of_nodes()
m = G2.number_of_nodes()
nm = n + m
C = np.ones([nm, nm])*1000 #np.inf
C = np.ones([nm, nm])*np.inf
C[n:, m:] = 0
for u in G1.nodes():
......
......@@ -54,7 +54,7 @@ class RiesenCostFunction():
""" u et v sont des id de noeuds """
n = len(G1[u])
m = len(G2[v])
sub_C = np.ones([n+m, n+m]) * 1000 # np.inf
sub_C = np.ones([n+m, n+m]) * np.inf
sub_C[n:, m:] = 0
i = 0
l_nbr_u = G1[u]
......
......@@ -65,7 +65,10 @@ class TestGEDMethods(unittest.TestCase):
g2.add_edges_from([(0,1,{'label': '3', 'label2': 1}),
(0,2,{'label': '1', 'label2': 2})])
self.assertEqual(ged(g1, g1)[0], 0)
self.assertEqual(ged(g1, g1, method='Riesen')[0], 0)
self.assertEqual(ged(g1, g1, method='Neighboorhood')[0], 0)
self.assertEqual(ged(g1, g1, method='Basic')[0], 0)
self.assertEqual(ged(g1, g1,
rho=[0, 1, 2, 3, 4, 5],
varrho=[0, 1, 2, 3, 4, 5])[0], 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment