def link_name_to_index(model):
    """ Generate a dictionary for link names and their indicies in the
    model. """
    return {
        link.name : index for index, link in enumerate(model.links)
    }