@staticmethod
def _create_graph_edges(graph):
    """Create the edges within all nodes of the contact graph.

        Args:
            graph (dict): The graph object that already contains the nodes
                and that's successor/predecessor lists should be generated.

        """
    node_list = list(graph.keys())
    for node1 in graph:
        node_list.remove(node1)
        for node2 in node_list:
            if (node1.to_node == node2.from_node and node1.from_node !=
                node2.to_node):
                if node2.to_time > node1.from_time:
                    graph[node1].successors.append(node2)
                    graph[node2].predecessors.append(node1)
            elif node2.to_node == node1.from_node and node2.from_node != node1.to_node:
                if node1.to_time > node2.from_time:
                    graph[node2].successors.append(node1)
                    graph[node1].predecessors.append(node2)
    for node in graph:
        graph[node].successors.sort(key=lambda c: (c.to_time, hash(c.
            to_node)), reverse=True)
        graph[node].predecessors.sort(key=lambda c: (c.to_time, hash(c.
            from_node)), reverse=True)
