From 755c174b4ec4ea4931f4d48d355717f8911c97f8 Mon Sep 17 00:00:00 2001 From: Benoit GAUZERE Date: Thu, 16 Nov 2017 17:47:14 +0100 Subject: [PATCH] Adding a generic lsap solver as parameter --- ged/bipartiteGED.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ged/bipartiteGED.py b/ged/bipartiteGED.py index 2599eb0..1372b7e 100644 --- a/ged/bipartiteGED.py +++ b/ged/bipartiteGED.py @@ -24,10 +24,10 @@ def computeBipartiteCostMatrix(G1, G2, cf=BasicCostFunction(1, 3, 1, 3)): return C -def getOptimalMapping(C): +def getOptimalMapping(C, lsap_solver=linear_sum_assignment): """Compute an optimal linear mapping according to cost Matrix C inclure les progs C de Seb """ - row_ind, col_ind = linear_sum_assignment(C) + row_ind, col_ind = lsap_solver(C) return col_ind, row_ind[np.argsort(col_ind)]