質問編集履歴

1

エラーの変更(### 発生している問題・エラーメッセージ)

2022/11/14 05:05

投稿

TKng1998
TKng1998

スコア1

test CHANGED
File without changes
test CHANGED
@@ -17,12 +17,16 @@
17
17
  ### 発生している問題・エラーメッセージ
18
18
 
19
19
  ```
20
- nx.graph_edit_distance(G1, G2,node_subst_cost=(G1.nodes[G1], G2.nodes[G2]), node_del_cost=1, node_ins_cost=1)
20
+ >>> nx.graph_edit_distance(G1, G2,node_del_cost=1,node_ins_cost=2)
21
21
  Traceback (most recent call last):
22
22
  File "<stdin>", line 1, in <module>
23
- File "/Users/tokut/opt/anaconda3/envs/py39/lib/python3.9/site-packages/networkx/classes/reportviews.py", line 194, in __getitem__
23
+ File "/Users/tokut/opt/anaconda3/lib/python3.9/site-packages/networkx/algorithms/similarity.py", line 190, in graph_edit_distance
24
+ for vertex_path, edge_path, cost in optimize_edit_paths(
25
+ File "/Users/tokut/opt/anaconda3/lib/python3.9/site-packages/networkx/algorithms/similarity.py", line 1089, in optimize_edit_paths
24
- return self._nodes[n]
26
+ del_costs = [node_del_cost(G1.nodes[u]) for u in pending_u]
27
+ File "/Users/tokut/opt/anaconda3/lib/python3.9/site-packages/networkx/algorithms/similarity.py", line 1089, in <listcomp>
28
+ del_costs = [node_del_cost(G1.nodes[u]) for u in pending_u]
25
- KeyError: <networkx.classes.graph.Graph object at 0x7fb1f01f2340>
29
+ TypeError: 'int' object is not callable
26
30
  ```
27
31
 
28
32
  ### 該当のソースコード