def _get_sink_set(sink, mapped, Sg):
    """ Given a node, return either the its associated candidates or
    previously mapped nodes.
    """
    sink_node = Sg.nodes[sink]
    sink_candidates = sink_node['candidates']
    return sink_candidates if sink not in mapped else mapped[sink]