def get_essential_nodes(target):
    """"Return the nodes that are linked through an edge in the optimal graph.
    
    Parameters
    ----------
    target : `networkx.Graph`
        Graph representing the optimal design.

    Returns
    -------
    essential : set
        Nodes that are linked by edges in the target graph.
    """
    essential = set()
    for start, end in target.edges:
        essential.add(start)
        essential.add(end)
    return essential