def validate_graph(graph):
    """
    Takes a graph in the form of a dictionary and verifies that for every edge member there exists a source node.
    If no source node is found from existing edge members, one is created with an empty edge [].
    :param graph:
    :return:
    """
    vertices = [vertex for edge in graph.values() for vertex in edge]
    for vertex in vertices:
        if vertex not in graph.copy().keys():
            graph[vertex] = []
    return graph