GMatch4py
GMatch4py copied to clipboard
How to define substitution cost?
Hi.
I have a question about the substitution cost. When we define
ged=gm.GraphEditDistance(1,1,1,1)
, I think that the parameters are equal to node_del,node_ins,edge_del,edge_ins
. Is there a way to input user-defined substitution cost matrix (e.g., a cost of 1 for a mis-match between two edges A and B, and a cost of 0 if two edges are identical)? Or the substitution costs are computed automatically?
Thank you.
Tran.
Hi,
You can create a new class in the gmatch4py.ged
module that inherit from AbstractGraphEditDistance
. In this new class, you can redefine all cost function with the methods : insert_cost()
, delete_cost()
and substitute_cost()
Best, Jacques
Hi Jacques,
Thank you for the answer. I will try.
Tran.