Skip to content

Commit

Permalink
weisfeiler_lehman_graph_hash: add `not_implemented_for("multigraph"…
Browse files Browse the repository at this point in the history
…)` decorator (networkx#7614)

* weisfeiler_lehman_graph_hash: add not_implemented_for("multigraph") decorator (See Issue networkx#7593)

* weisfeiler_lehman_subgraph_hashes: add not_implemented_for("multigraph") decorator
  • Loading branch information
PhilippvK authored Aug 28, 2024
1 parent 9c3972e commit 8eae128
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions networkx/algorithms/graph_hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def _neighborhood_aggregate(G, node, node_labels, edge_attr=None):
return node_labels[node] + "".join(sorted(label_list))


@nx.utils.not_implemented_for("multigraph")
@nx._dispatchable(edge_attrs={"edge_attr": None}, node_attrs="node_attr")
def weisfeiler_lehman_graph_hash(
G, edge_attr=None, node_attr=None, iterations=3, digest_size=16
Expand Down Expand Up @@ -160,6 +161,7 @@ def weisfeiler_lehman_step(G, labels, edge_attr=None):
return _hash_label(str(tuple(subgraph_hash_counts)), digest_size)


@nx.utils.not_implemented_for("multigraph")
@nx._dispatchable(edge_attrs={"edge_attr": None}, node_attrs="node_attr")
def weisfeiler_lehman_subgraph_hashes(
G,
Expand Down

0 comments on commit 8eae128

Please sign in to comment.