NAME

Data::Hopen::OrderedPredecessorGraph - Graph that tracks the order in which edges are added

SYNOPSIS

Just like a Graph with two exceptions:

  • Every call to "add_edge" (or other edge-adding routines) tracks the order in an attribute on that edge; and

  • New routine "ordered_predecessors" returns the predecessors sorted in the order they were added.

This is unlike "predecessors" in Graph and "edges_to" in Graph, which return the predecessors in random order.

FUNCTIONS

add_edge

Add an edge. Exactly as "add_edge" in Graph except that it also creates the new edge attribute to hold the order. Returns the graph.

"add_edges" in Graph is implemented using add_edge, so we don't need to override add_edges.

ordered_predecessors

Return a list of the predecessors of the given vertex, in order that the edges were added to that vertex. Exactly as "predecessors" in Graph except for the stable order.

add_edge_by_id

Add a multiedge. Exactly as "add_edge_by_id" in Graph except that it also creates the new edge attribute to hold the order. Returns the graph. Can only be used on a multiedged graph.

add_edge_get_id

Add a multiedge. Exactly as "add_edge_get_id" in Graph except that it also creates the new edge attribute to hold the order. Returns the ID of the new edge. Can only be used on a multiedged graph.