Ejemplo n.º 1
0
def populated_graph():
    graph = sgraph.Sgraph()
    graph.dict = {
        'a': ['b'],
        'b': ['c', 'd'],
        'c': ['b', 'a'],
        'd': ['c'],
        'e': []
    }
    return graph
Ejemplo n.º 2
0
def depth_populated_graph():
    graph = sgraph.Sgraph()
    graph.dict = {
        'a': ['b', 'c', 'e'],
        'b': ['d', 'f'],
        'c': ['g'],
        'd': [],
        'e': [],
        'f': ['e'],
        'g': []
    }
    return graph
Ejemplo n.º 3
0
def breadth_populated_graph():
    graph = sgraph.Sgraph()
    graph.dict = {
        'a': ['b', 'c'],
        'b': ['d', 'e'],
        'c': ['f', 'g'],
        'd': [],
        'e': ['h'],
        'f': [],
        'g': [],
        'h': [],
    }
    return graph
Ejemplo n.º 4
0
def test___init__():
    """Test instantiates simple graph with dictionary."""
    assert sgraph.Sgraph().dict == {}
Ejemplo n.º 5
0
def empty_graph():
    graph = sgraph.Sgraph()
    return graph