def essential_network_spec(parameter_graph):
    """Returns the essential network specification"""
    # Get network specification
    net_spec = parameter_graph.network().specification()
    # Get list of node specifications
    nodes_spec = [s.strip() for s in net_spec.strip().split('\n') if s]
    # Number of specs should equal number of nodes
    assert len(nodes_spec) == parameter_graph.dimension()
    # Check if a node spec correspond to an essential node
    essential_node = lambda spec: spec.strip().endswith('E') and spec.count(':') == 2
    # Make all nodes essential
    ess_nodes_spec = [spec if essential_node(spec) else spec + ' : E' for spec in nodes_spec]
    # Get the essential network spec
    ess_net_spec = '\n'.join(ess_nodes_spec)
    return ess_net_spec