Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박권수
/
Algorithm_HW5
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박권수
2020-11-01 17:53:45 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c6bef59b5d092ae6607e6c6389b839c11d814f8d
c6bef59b
1 parent
8ce93de6
init Dijkstra Algorithm
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
HW5_박권수_2015104173.py
HW5_박권수_2015104173.py
View file @
c6bef59
...
...
@@ -58,6 +58,11 @@ def Kruskal(graph) :
return
F
#Dijkstra Algorithm
#Kruskal Algorithm
graph
=
{
...
...
@@ -74,4 +79,10 @@ graph = {
}
mst
=
Kruskal
(
graph
)
print
(
'Kruskal Algorithm : '
,
"
\n
"
,
mst
)
\ No newline at end of file
print
(
'Kruskal Algorithm : '
,
"
\n
"
,
mst
)
#Dijkstra Algorithm
inf
=
1000
w
=
[[
0
,
7
,
4
,
6
,
1
],[
inf
,
0
,
inf
,
inf
,
inf
],
[
inf
,
2
,
0
,
5
,
inf
],
[
inf
,
3
,
inf
,
0
,
inf
],
[
inf
,
inf
,
inf
,
1
,
0
]]
n
=
len
(
w
)
...
...
Please
register
or
login
to post a comment