pylibmgm.MgmModel
- class pylibmgm.MgmModel
Multi-graph matching (MGM) model.
Represents a collection of graphs and pairwise GM models between them. This is the main data structure for multi-graph matching problems.
Methods
__init__()Create an empty MGM model.
add_model(gm_model)Add a pairwise GM model to this MGM problem.
create_submodel(graph_ids)Create a submodel containing only the specified graphs.
Attributes
Name
Type
Description
graphs
list[
Graph]List of all graphs. IDs graph.id should be sorted in ascending order starting from zero: (0,1,2,3,4,…).
models
dict[tuple[int, int],
GmModel]Dictionary of pairwise GM models indexed by (graph1_id, graph2_id).
no_graphs
int
Number of graphs in the problem.
- __init__() None
Create an empty MGM model.
- add_model(gm_model: pylibmgm.GmModel) None
Add a pairwise GM model to this MGM problem.
- Parameters:
gm_model (GmModel) – Pairwise model to add.
- create_submodel(graph_ids: List[int]) pylibmgm._pylibmgm.MgmModel
Create a submodel containing only the specified graphs.
Note: Graph ids of returned problem will have IDs (0,1,2,3,…) and thus may not coincide with given problems graph IDs.
- Parameters:
graph_ids (list[int]) – IDs of graphs to include in the submodel.
- Returns:
New model with only the specified graphs and their pairwise models.
- Return type: