Created
August 1, 2014 16:05
-
-
Save ircmaxell/f1e67efce367502d4ab1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Gliph\Graph; | |
/** | |
* Interface for bidirectional directed graph datastructures. | |
*/ | |
interface BiDirectedGraph extends DirectedGraph { | |
/** | |
* Loops over each vertex that is inbound to the given vertex. | |
* | |
* The generator yields an edge as key and the adjacent vertex as value. The | |
* form by which the edge is represented may vary from one graph | |
* implementation to another, but the representation should be the same as | |
* produced by the graph's eachEdge() implementation. | |
* | |
* @see Graph::eachEdge() | |
* | |
* @param object $vertex | |
* The vertex whose in-edges should be visited. | |
* | |
* @return \Generator | |
* A generator that yields the edge as key and adjacent vertex as value. | |
* | |
* @throws NonexistentVertexException | |
* Thrown if the vertex provided in the first parameter is not present in | |
* the graph. | |
*/ | |
public function eachInbound($vertex); | |
/** | |
* Loops over each vertex that is outbound from the given vertex. | |
* | |
* The generator yields an edge as key and the adjacent vertex as value. The | |
* form by which the edge is represented may vary from one graph | |
* implementation to another, but the representation should be the same as | |
* produced by the graph's eachEdge() implementation. | |
* | |
* @see Graph::eachEdge() | |
* | |
* @param object $vertex | |
* The vertex whose out-edges should be visited. | |
* | |
* @return \Generator | |
* A generator that yields the edge as key and adjacent vertex as value. | |
* | |
* @throws NonexistentVertexException | |
* Thrown if the vertex provided in the first parameter is not present in | |
* the graph. | |
*/ | |
public function eachOutbound($vertex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment