From 41de1ba314a850feebb680feff1aa6342eb199d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=BE=D1=80=D0=BE=D0=B7=D0=BE=D0=B2=20=D0=90=D0=BD?= =?UTF-8?q?=D0=B4=D1=80=D0=B5=D0=B9?= Date: Wed, 10 Nov 2021 11:26:41 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D0=BB(=D0=B0)=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20'flu?= =?UTF-8?q?tter/lib/src'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flutter/lib/src/graph.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flutter/lib/src/graph.dart b/flutter/lib/src/graph.dart index 2d90efd..cd8707b 100644 --- a/flutter/lib/src/graph.dart +++ b/flutter/lib/src/graph.dart @@ -363,6 +363,7 @@ class Graphs { List getDots() => _dots; String getName() => _name; String? getNameByNum(int n) => _nameTable[n]; + Map getNameTable() => _nameTable; int getDotAmount() => _dots.length; int? getNumByName(String n) { for (var i in _nameTable.keys) { @@ -567,6 +568,7 @@ class Graphs { }*/ List? bfsPath(int startDot, int goalDot) { + if (startDot == goalDot) return [startDot]; //if (!bfsHasPath(startDot, goalDot)) return null; startDot--; goalDot--; @@ -606,7 +608,6 @@ class Graphs { //Восстановим кратчайший путь //Для восстановления пути пройдём его в обратном порядке, и развернём. - List path = []; int cur = goalDot; //текущая вершина пути