Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing release notes for #1292 and #1306 #1336

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/source/api/algorithm_functions/centrality.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ Centrality
:toctree: ../../apiref

rustworkx.betweenness_centrality
rustworkx.degree_centrality
rustworkx.edge_betweenness_centrality
rustworkx.eigenvector_centrality
rustworkx.katz_centrality
rustworkx.closeness_centrality
rustworkx.in_degree_centrality
rustworkx.out_degree_centrality
11 changes: 11 additions & 0 deletions releasenotes/notes/accept-generators-31f080871015233c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
features:
- |
The following methods now support sequences and generators as inputs, in addition to
the existing support for lists:
IvanIsCoding marked this conversation as resolved.
Show resolved Hide resolved
* :meth:`~rustworkx.PyGraph.add_nodes_from` and :meth:`~rustworkx.PyDiGraph.add_nodes_from`
* :meth:`~rustworkx.PyGraph.add_edges_from` and :meth:`~rustworkx.PyDiGraph.add_edges_from`
* :meth:`~rustworkx.PyGraph.add_edges_from_no_data` and :meth:`~rustworkx.PyDiGraph.add_edges_from_no_data`
* :meth:`~rustworkx.PyGraph.extend_from_edge_list` and :meth:`~rustworkx.PyDiGraph.extend_from_edge_list`
* :meth:`~rustworkx.PyGraph.extend_from_weighted_edge_list` and :meth:`~rustworkx.PyDiGraph.extend_from_weighted_edge_list`

33 changes: 33 additions & 0 deletions releasenotes/notes/degree-centrality-e7ddf61a9a8fbafc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
features:
- |
Added a new function, :func:`~rustworkx.degree_centrality` which is used to
compute the degree centrality for all nodes in a given graph. For
example:

.. jupyter-execute::

import rustworkx as rx
from rustworkx.visualization import mpl_draw

graph = rx.generators.hexagonal_lattice_graph(4, 4)
centrality = rx.degree_centrality(graph)

# Generate a color list
colors = []
for node in graph.node_indices():
centrality_score = centrality[node]
graph[node] = centrality_score
colors.append(centrality_score)
mpl_draw(
graph,
with_labels=True,
node_color=colors,
node_size=650,
labels=lambda x: "{0:.2f}".format(x)
)

- |
Added two new functions, :func:`~rustworkx.in_degree_centrality` and
:func:`~rustworkx.out_degree_centrality` to calculate two special
types of degree centrality for directed graphs.
Loading