def build_k33_graph():
    """Makes a new K3,3 graph.
       Ref: http://mathworld.wolfram.com/UtilityGraph.html"""
    graph = UndirectedGraph()

    # K3,3 has 6 nodes
    for _ in range(1, 7):
        graph.new_node()

    # K3,3 has 9 edges
    # --Edge: a
    graph.new_edge(1, 4)
    # --Edge: b
    graph.new_edge(1, 5)
    # --Edge: c
    graph.new_edge(1, 6)
    # --Edge: d
    graph.new_edge(2, 4)
    # --Edge: e
    graph.new_edge(2, 5)
    # --Edge: f
    graph.new_edge(2, 6)
    # --Edge: g
    graph.new_edge(3, 4)
    # --Edge: h
    graph.new_edge(3, 5)
    # --Edge: i
    graph.new_edge(3, 6)

    return graph
def build_k33_graph ( ) : graph = UndirectedGraph ( ) for _ in range ( 1 , 7 ) : graph . new_node ( ) graph . new_edge ( 1 , 4 ) graph . new_edge ( 1 , 5 ) graph . new_edge ( 1 , 6 ) graph . new_edge ( 2 , 4 ) graph . new_edge ( 2 , 5 ) graph . new_edge ( 2 , 6 ) graph . new_edge ( 3 , 4 ) graph . new_edge ( 3 , 5 ) graph . new_edge ( 3 , 6 ) return graph
Makes a new K3,3 graph.
       Ref: http://mathworld.wolfram.com/UtilityGraph.html