'If ``edge`` is not in ``dictionary``, adds ``edge`` to the
dictionary and sets its value to ``[elem]``.  Otherwise
appends ``elem`` to the value of existing entry.
Note that edges are undirected, thus `(A, B) = (B, A)`.'

@staticmethod
def _add_edge_append(dictionary, edge, elem):

    if (edge in dictionary):
        dictionary[edge].append(elem)
    else:
        dictionary[edge] = [elem]
