'Given the objects and the relevant morphisms of a diagram,
returns the adjacency lists of the underlying undirected
graph.'

@staticmethod
def _get_undirected_graph(objects, merged_morphisms):

    adjlists = {}
    for obj in objects:
        adjlists[obj] = []
    for morphism in merged_morphisms:
        adjlists[morphism.domain].append(morphism.codomain)
        adjlists[morphism.codomain].append(morphism.domain)
    for obj in adjlists.keys():
        adjlists[obj].sort(key=default_sort_key)
    return adjlists
