This method computes a single isomorphism between M and N, if one exists, and returns null if no such isomorphism exists.
The output is a HashTable, where the keys are elements of the groundSet of M, and their corresponding values are elements of (the ground set of) N.
To obtain all isomorphisms between two matroids, use getIsos.
i1 : M = matroid({a,b,c},{{a,b},{a,c}})
o1 = a "matroid" of rank 2 on 3 elements
o1 : Matroid
|
i2 : isomorphism(M, uniformMatroid(2,3)) -- not isomorphic
|
i3 : (M5, M6) = (5,6)/completeGraph/matroid
o3 = (a "matroid" of rank 4 on 10 elements, a "matroid" of rank 5 on 15
------------------------------------------------------------------------
elements)
o3 : Sequence
|
i4 : minorM6 = minor(M6, set{8}, set{4,5,6,7})
o4 = a "matroid" of rank 4 on 10 elements
o4 : Matroid
|
i5 : time isomorphism(M5, minorM6)
-- used 0.00850673 seconds
o5 = HashTable{0 => 1}
1 => 0
2 => 3
3 => 2
4 => 6
5 => 5
6 => 4
7 => 9
8 => 8
9 => 7
o5 : HashTable
|
i6 : isomorphism(M5, M5)
o6 = HashTable{0 => 0}
1 => 1
2 => 2
3 => 3
4 => 4
5 => 5
6 => 6
7 => 7
8 => 8
9 => 9
o6 : HashTable
|
i7 : N = relabel M6
o7 = a "matroid" of rank 5 on 15 elements
o7 : Matroid
|
i8 : time phi = isomorphism(N,M6)
-- used 1.7614 seconds
o8 = HashTable{0 => 11 }
1 => 0
2 => 1
3 => 6
4 => 9
5 => 8
6 => 5
7 => 12
8 => 7
9 => 3
10 => 10
11 => 4
12 => 2
13 => 13
14 => 14
o8 : HashTable
|