분류 | 게시판 |
베스트 |
|
유머 |
|
이야기 |
|
이슈 |
|
생활 |
|
취미 |
|
학술 |
|
방송연예 |
|
방송프로그램 |
|
디지털 |
|
스포츠 |
|
야구팀 |
|
게임1 |
|
게임2 |
|
기타 |
|
운영 |
|
임시게시판 |
|
while(repeat):
repeat -= 1
min = 100
for (x,y) in basket:
#Distance between two nodes is the euclidean distance between the points
k = math.fabs( (verx- x ) + (very-y) )
if graph[x,y] > k: #update weight of vertex if searched way is cheaper.
graph[x,y]= k
if min > graph[x,y]: #get the vertex having minimum weight among the adjacent MST.
min = graph[x,y]
minIndex = (x,y)
if min is 100:
break
else:
result += min
basket.remove(minIndex)
(verx, very) = minIndex
죄송합니다. 댓글 작성은 회원만 가능합니다.