Exemplo n.º 1
0
def go():
    forbidden = [make_kite(),
                 make_cycle(4),
                 make_cycle(6),
                 make_cycle(8),
                 make_wheel(6)]
    g = make_cycle(5)
    check_graph(DROPS, g, forbidden)
    return
Exemplo n.º 2
0
 def testCliqueCutset(self):
     # no cutset
     result = clique_cutset(make_cycle(5))
     self.assertEqual(result, None)
     # cutset is subclique of the maximal clique
     result = clique_cutset(make_diamond())
     self.assertEqual(result, (0, 1))
     # just a normal cutset
     result = clique_cutset(make_kite())
     self.assertEqual(result, (2,))
     # whole graph is a clique
     result = clique_cutset(make_clique(4))
     self.assertEqual(result, (0, 1, 2, 3))
     # a random graph
     result = clique_cutset(make_bridge())
     self.assertEqual(result, (0, 1))
Exemplo n.º 3
0
Email:   [email protected]
Version: 2015-10-20
-------------------------------------------------------
"""
import sys
sys.path.append("..") # Adds higher directory to python modules path.
from graph.helper import make_cycle, make_kite, make_clique, make_wheel
from utility.file import File
from graph import DalGraph
import os
from utility.generator import Generator
import logging
from pprint import PrettyPrinter
pp = PrettyPrinter(indent = 4)

FORBIDDEN =  [make_kite(),
              make_cycle(4),
              make_cycle(6),
              make_cycle(8),
              make_cycle(5),
              make_wheel(6)
              ]
BASE = "C5"
DIRECTORY=os.path.join(os.getcwd(), "Critical-graphs", BASE)
STARTING = make_cycle(5)
logging.basicConfig(filename=BASE+"finding_critical.log", level=logging.INFO,
                            format='%(asctime)s %(message)s')
LOGGER = logging.getLogger(__name__)
DROPS = 5

def go():