Java и Kotlin? 
                  
                  
                  
                  
                  
                  Разве Котлин не совместим с Java?
                  
                  
                  
                  
                  
                  Java
                  
                  
                  final var routeTwo = fastest.findPath(graph, source, target);
                  
                  
                  
                  
                  
                  Kotlin
                  
                  
                  val routeTwo = fastest.findPath(graph, source, target)
                  
                  
                  
                  
                  
                  Входные данные идентичны. Результат разный. 
                  
                  
                  
                  
                  
                  Объясните, почему это происходит? Почему при вызове из Java алгоритм находит самый быстрый маршрут, но тот же самый класс на полностью идентичных данных при вызове из Котлин выдаёт иной маршрут?
                  
                  
                  
                  
                  
                  Java
                  
                  
                  
                  
                  
                  Find the path from D to C
                  
                  
                      - the shortest take 20 min and the path is [D, C]
                  
                  
                      - the fastest take 19 min and the path is [D, E, F, G, C]
                  
                  
                  
                  
                  
                  Kotlin
                  
                  
                  
                  
                  
                  Find the path from D to C
                  
                  
                           - the shortest take 20 min and the path is [D, C]
                  
                  
                           - the fastest take 20 min and the path is [D, C]
                  
                  
                  
                  
                  
                  https://github.com/rabestro/graph-search-algorithm-java
                  
                  
                
Вангую, что алгоритм выдаёт разные результаты в зависимости от реализации Map на входе
Обсуждают сегодня