Skip to content

Commit 81a457c

Browse files
committedNov 15, 2017
Change Object name
Dijkstras -> Main
1 parent ca1a594 commit 81a457c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎Dijkstras.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.collection.mutable
22

3-
object Dijkstras extends App {
3+
object Main extends App {
44

55
val graphs = new SimpleGraph[String](
66
Map(
@@ -15,6 +15,7 @@ object Dijkstras extends App {
1515
)
1616
)
1717
graphs.getShortestPath("A","E")
18+
1819
}
1920

2021
case class SimpleGraph[N](succs: Map[N, Map[N, Int]]) {
@@ -68,7 +69,7 @@ case class SimpleGraph[N](succs: Map[N, Map[N, Int]]) {
6869
nextNode = shortestPath(start)(succs.keySet.filterNot(unreachedVertexSet.contains(_)))(currentDistance) // 次のノードを決定させる
6970
unreachedVertexSet = unreachedVertexSet.-(nextNode)
7071
}
71-
println("result : ", currentDistance(finish)._2.reverse.toSeq)
72+
println(currentDistance(finish)._2.reverse.toSeq)
7273
}
7374

74-
}
75+
}

0 commit comments

Comments
 (0)
Please sign in to comment.