Exemple #1
0
def run():
    checker = IndividualizationRefinementChecker()
    command = None
    chosen_coloring = False
    while not chosen_coloring:
        coloring = input(
            "Would you like to 1. Use normal Coloring or 2. Use fast Coloring")
        if coloring == "1":
            checker._checker = ColorRefinementChecker()
            chosen_coloring = True
        elif coloring == "2":
            checker._checker = FastPartitionRefinementChecker()
            chosen_coloring = True
        else:
            print("Please pick either 1 or 2")
    chosen_mode = False
    while not chosen_mode:
        mode = input(
            "Would you like to 1. Find an isomorphism or 2. Count the automorphisms"
        )
        if mode == "1":
            command = "isIsomorphic"
            chosen_mode = True
        elif mode == "2":
            command = "countIsomorphisms"
            chosen_mode = True
        else:
            print("Please pick either 1 or 2")
    stop = False
    while not stop:
        execute_file(command, checker)
        cont = input("Would you like to read another file? Y/N")
        if cont == "Y":
            stop = False
        elif cont == "N":
            stop = True
	def setUp(self):
		self._checker = IndividualizationRefinementChecker()
 def setUp(self):
     self._checker = IndividualizationRefinementChecker()
     self._checker._checker = FastPartitionRefinementChecker()
from isomorphism.ColorRefinementChecker import ColorRefinementChecker
from graph.graphIO import loadgraph
from isomorphism.IndividualizationRefinementChecker import IndividualizationRefinementChecker

# L = loadgraphs('data\colorref_smallexample_4_7.grl')
# checker = ColorRefinementChecker()
# print(checker.isIsomorphic(L[0][0], L[0][1]))
# print(checker.isIsomorphic(L[0][0], L[0][2]))
# print(checker.isIsomorphic(L[0][0], L[0][3]))

L = loadgraph('data\\basicAut1.gr')
checker = IndividualizationRefinementChecker()
print(checker.countIsomorphisms(L[0], L[0]))
#print(checker.countIsomorphisms(L[0][1], L[0][2]))
#L = loadgraphs('data\\trees90.grl')
#print(checker.countIsomorphisms(L[0][0], L[0][3]))
#print(checker.countIsomorphisms(L[0][1], L[0][2]))
Exemple #5
0
 def setUp(self):
     self._checker = IndividualizationRefinementChecker()
     self._alphabet_jan = loadgraphs("alphabet_jan.grl")
     self._alphabet_tygo = loadgraphs("alphabet_tygo.grl")
     self._alphabet_pixel = loadgraphs("alphabet_pixel.grl")