Skip to content

v0.7.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@clue clue released this 12 Sep 14:39
  • Feature: Add new Set\Vertices and Set\Edges classes that handle common
    operations on a Set of multiple Vertex and Edge instances respectively.
    (#48)
  • BC break: Move operations and their corresponding constants concerning Sets
    to their corresponding Sets:
Old name New name
Edge\Base::getFirst() Set\Edges::getEdgeOrder()
Edge\Base::getAll() Set\Edges::getEdgesOrder()
Edge\Base::ORDER_* Set\Edges::ORDER_*
--- ---
Vertex::getFirst() Set\Vertices::getVertexOrder()
Vertex::getAll() Set\Vertices::getVerticesOrder()
Vertex::ORDER_ Set\Vertices::ORDER_*
  • BC break: Each getVertices*() and getEdges*() method now returns a Set
    instead of a primitive array of instances. Most of the time this should
    work without changing your code, because each Set implements an Iterator
    interface and can easily be iterated using foreach. However, using a Set
    instead of a plain array differs when checking its boolean value or
    comparing two Sets. I.e. if you happen to want to check if an Set is empty,
    you now have to use the more explicit syntax $set->isEmpty().
  • BC break: Vertex::getVertices(), Vertex::getVerticesEdgeTo() and
    Vertex::getVerticesEdgeFrom() now return a Set\Vertices instance that
    may contain duplicate vertices if parallel (multiple) edges exist. Previously
    there was no easy way to detect this situation - this is now the default. If
    you also want to get unique / distinct Vertex instances, use
    Vertex::getVertices()->getVerticesDistinct() where applicable.
  • BC break: Remove all occurances of getVerticesId(), use
    getVertices()->getIds() instead.
  • BC break: Merge Cycle into Walk (#61).
    As such, its static factory methods had to be renamed. Update your references if applicable:
Old name New name
Cycle::factoryFromPredecessorMap() Walk::factoryCycleFromPredecessorMap()
Cycle::factoryFromVertices() Walk::factoryCycleFromVertices()
Cycle::factoryFromEdges() Walk::factoryCycleFromEdges()
  • BC break: Remove Graph::isEmpty() because it's not well-defined and might
    be confusing. Most literature suggests it should check for existing edges,
    whereas the old behavior was to check for existing vertices instead. Use either
    of the new and more transparent methods
    Algorithm\Property\GraphProperty::isNull() (old behavior) or (where applicable)
    Algorithm\Property\GraphProperty::isEdgeless() (#63).
  • BC break: Each of the above methods (Walk::factoryCycleFromPredecessorMap(),
    Walk::factoryCycleFromVertices(), Walk::factoryCycleFromEdges()) now
    actually makes sure the returned Walk instance is actually a valid Cycle,
    i.e. the start Vertex is the same as the end Vertex (#61)
  • BC break: Each Algorithm\ShortestPath algorithm now consistenly does not
    return a zero weight for the root Vertex and now supports loop edges on the root
    Vertex (#62)
  • BC break: Each Algorithm\ShortestPath algorithm now consistently throws an
    OutOfBoundsException for unreachable vertices
    (#62)
  • BC break: A null Graph (a Graph with no Vertices and thus no Edges) is not a
    valid tree (because it is not connected), adjust Algorithm\Tree\Base::isTree()
    accordingly.
    (#72)
  • BC break: Remove all occurances of getNumberOfVertices() and
    getNumberOfEdges() (#75 and
    #48):
Old name New name
$set->getNumberOfVertices() count($set->getVertices())
$set->getNumberOfEdges() count($set->getEdges())
  • BC break: Replace base Set class with Set\DualAggregate interface. This
    is unlikely to affect you, but might potentially break your custom
    inheritance or polymorphism for algorithms.
    (#75)
  • Feature: Add Algorithm\ShortestPath\Base::hasVertex(Vertex $vertex) to check whether
    a path to the given Vertex exists (#62).
  • Feature: Support opening GraphViz images on Mac OS X in default image viewer
    (#67 @onigoetz)
  • Feature: Add Algorithm\MinimumSpanningTree\Base::getWeight() to get total
    weight of resulting minimum spanning tree (MST).
    (#73)
  • Feature: Each Algorithm\MinimumSpanningTree algorithm now supports
    undirected and mixed Graphs, as well as null weights for Edges.
    (#73)
  • BC break: Each Algorithm\MinimumSpanningTree algorithm now throws an
    UnexpectedValueException for unconnected Graphs (and thus also null Graphs).
    (#73)
  • Feature: Add Walk::factoryFromVertices()
    (#64).
  • Fix: Checking Walk::isValid()
    (#61)
  • Fix: Missing import prevented
    Algorithm\ShortestPath\MooreBellmanFord::getCycleNegative() from actually
    throwing the right UnderflowException if no cycle was found
    (#62)
  • Fix: Calling Exporter\Image::setFormat() had no effect due to misassignment
    (#70 @fgm)