retworkx 0.5.0
This release include a number of new features and bug fixes. The main
focus of the improvements of this release was to increase the ease of
interacting with graph objects. This includes adding support for generating dot
output which can be used with graphviz (or similar tools) for visualizing
graphs adding more methods to query the state of graph, adding a generator
module for easily creating graphs of certain shape, and implementing the
mapping protocol so you can directly interact with graph objects.
Added
- A new method,
to_dot()
, was added toPyGraph
andPyDiGraph
. It will
generate a dot format representation of the object which can be used
with Graphivz (or similar tooling) to generate visualizations of the
graph. - Added a new function,
strongly_connected_components()
, to get the list
of strongly connected components of aPyDiGraph
object. - A new method,
compose()
, for combing another graph object of the same
type was added toPyGraph
andPyDiGraph
. - The
PyGraph
andPyDigraph
classes now implement the Python mapping
protocol for interacting with graph nodes. You can now access and
interact with node data directly by using standard map access patterns
in python. For example, runninggraph[1]
will return the data for the
index at node 1. - A new module,
retworkx.generators
, has been added. Functions in this
module can be used for quickly generating graphs of certain shape. - A new method,
remove_node_retain_edges()
, has been added to the
PyDiGraph
class. This method can be used to remove a node and add
edges from its predecesors to its successors. - Two new methods,
edge_list()
andweighted_edge_list()
, for getting a
list of tuples with the edge source and target (with or without edge
weights) have been added toPyGraph
andPyDigraph
. - A new function,
cycle_basis()
, for getting a list of cycles which form
a basis for cycles of aPyGraph
object. - Two new functions,
graph_floyd_warshall_numpy()
and
digraph_floyd_warshall_numpy()
, were added for running the Floyd Warshall
algorithm and returning all the shortest path lengths as a distance
matrix. - A new constructor method,
read_edge_list()
, has been added toPyGraph
and
PyDigraph
. This method will take in a path to an edge list file and
will read that file and generate a new object from the contents. - A new method,
extend_from_edge_list()
, has been added toPyGraph
and
PyDiGraph
. This method takes in an edge list and will add both the edges and
nodes (if a node index used doesn't exist yet) in the list to the graph.
Fixes
- The limitation with
is_isomorphic()
andis_isomorphic_node_match()
functions
that would cause segfaults when comparing graphs with node removals
has been fixed. You can now run either function with any
PyDiGraph
/PyDAG
objects, even if there are node removals. Fixes #27 - If an invalid node index was passed as part of the
first_layer
argument to thelayers()
function