Skip to content

retworkx 0.4.0

Compare
Choose a tag to compare
@mtreinish mtreinish released this 17 Jul 12:41
0.4.0
7d889f9

Changelog

This release includes many new features and fixes, including improved
performance and better documentation. But, the biggest change for this
release is that this is the first release of retworkx that supports
compilation with a stable released version of rust. This was made
possible thanks to all the hard work of the PyO3 maintainers and
contributors in the PyO3 0.11.0 release.

Added

  • A new class for undirected graphs, PyGraph, was added.
  • 2 new functions graph_adjacency_matrix() and
    digraph_adjacency_matrix() to get the adjacency matrix of a PyGraph
    and PyDiGraph object.
  • A new PyDiGraph method, find_adjacent_node_by_edge(), was added. This is
    used to locate an adjacent node given a condition based on the edge between them.
  • New methods, add_nodes_from(), add_edges_from(),
    add_edges_from_no_data(), and remove_nodes_from() were added to PyDiGraph
    (and PyGraph). These methods allow for the addition (and removal) of
    multiple nodes or edges from a graph in a single call.
  • A new function, graph_greedy_coloring(), which is used to return a
    coloring map from a PyGraph object.
  • 2 new functions, graph_astar_shortest_path() and digraph_astar_shortest_path(),
    to find the shortest path from a node to a specified goal using the A*
    search algorithm.
  • 2 new functions, graph_all_simple_paths() and
    digraph_all_simple_paths(), to return a list of all the simple paths
    between 2 nodes in a PyGraph or PyDiGraph object.
  • 2 new functions, directed_gnp_random_graph() and
    undirected_gnp_random_graph(), to generate Gnp random PyDiGraph and
    PyGraph objects.
  • 2 new functions, graph_dijkstra_shortest_path_lengths() and
    digraph_dijkstra_shortest_path_lengths(), were added for find the shortest paths
    between nodes in PyGraph or PyDiGraph object using Dijkstra's
    algorithm.

Changed

  • The PyDAG class was renamed PyDiGraph to better reflect it's
    functionality. For backwards compatibility PyDAG still exists as a python
    subclass of PyDiGraph. No changes should be required for existing
    users.
  • numpy is now a dependency of retworkx. This is used for the adjacency
    matrix functions to return numpy arrays. The minimum version of numpy
    supported is 1.16.0.

Fixes

  • The retworkx exception classes are now properly exported from the
    retworkx module. In prior releases it was not possible to import the
    exception classes (normally to catch one being raised) requiring users
    to catch the base Exception class. This has been fixed so a
    specialized retworkx exception class can be used.