質問編集履歴
1
title
CHANGED
File without changes
|
body
CHANGED
@@ -25,6 +25,7 @@
|
|
25
25
|
vu_dist = dist[v] + cost
|
26
26
|
TypeError: unsupported operand type(s) for +: 'int' and 'str'
|
27
27
|
### 自作のプログラム
|
28
|
+
```Python
|
28
29
|
import networkx as nx
|
29
30
|
import matplotlib.pyplot as plt
|
30
31
|
import numpy as np
|
@@ -105,6 +106,7 @@
|
|
105
106
|
if source != target:
|
106
107
|
dist2 =mapping[target]
|
107
108
|
print(f"({source}, {target}): {dist2:4.2f}")
|
109
|
+
```
|
108
110
|
### 試したこと
|
109
111
|
|
110
112
|
まず、関数f(x,y)を作る前に各ノード(x,y)の最短経路の長さと最短経路を表示させた
|