/// <summary> /// Walks the edge supplied and returns the node at the end. As out the data on the edge is returned /// </summary> /// <param name="edgeKey"></param> /// <param name="edgeData"></param> /// <returns></returns> public Node WalkEdge(string edgeKey, out EdgeData edgeData) { if (NextEdges.TryGetValue(edgeKey, out Edge edge)) { edgeData = edge.EdgeData; return(edge.ToNode); } else { throw new DoubleLinkedDirectedGraphException($"Cannot walk edge {edgeKey} because it does not exist"); } }
/// <summary> /// Walks the edge supplied and returns the node at the end. /// </summary> /// <param name="nextNodeKey"></param> /// <returns></returns> public Node WalkEdge(string nextNodeKey) { string edgeKey = CreateEdgeKey(NodeKey, nextNodeKey); if (NextEdges.TryGetValue(edgeKey, out Edge edge)) { return(edge.ToNode); } else { throw new DoubleLinkedDirectedGraphException($"Cannot walk edge {edgeKey} because it does not exist"); } }