Fixed shrt path algorithm name for graphs with negative edges. Fix loader.

This commit is contained in:
Oleg Sh
2024-08-03 21:03:42 +02:00
parent d628dcd74d
commit c9201526a9
25 changed files with 117 additions and 4369 deletions

View File

@@ -30,7 +30,7 @@ function loadAsyncAlgorithms(onFinish) {
"ShortestPath.js",
"VerticesDegree.js"];
doIncludeAsync (pluginsList.map((plugin) => include ("model/plugins/" + plugin + "?v=" + globalVersion, modulDir)), onFinish);
doIncludeAsync (pluginsList.map((plugin) => include ("model/plugins/" + plugin, modulDir)), onFinish);
}
}

View File

@@ -23,7 +23,7 @@ FindShortPathNew.prototype.infinityValue = 1E9 - 1;
FindShortPathNew.prototype.getName = function(local)
{
return g_findShortPathName; //local == "ru" ? "Поиск кратчайший путь алгоритмом Дейкстры" : "Find shortest path using Dijkstra's algorithm";
return this.graph.hasNegative() ? g_findShortPathBellmanFordName : g_findShortPathName; //local == "ru" ? "Поиск кратчайший путь алгоритмом Дейкстры" : "Find shortest path using Dijkstra's algorithm";
}
FindShortPathNew.prototype.getId = function()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -129,6 +129,7 @@ var g_minimumSpanningTree = "Search of minimum spanning tree";
var g_modernGraphStyleName = "Visualization based on weight";
var g_RadiusAndDiameter = "Search graph radius and diameter";
var g_findShortPathName = "Find shortest path using Dijkstra's algorithm";
var g_findShortPathBellmanFordName = "Find shortest path using BellmanFord algorithm";
var g_VerticesDegreeName = "Calculate vertices degree";
var g_SpanningTreeResult = "Min Spanning Tree is";
var g_SpanningTreeIgnoreDir = "We ignored edges direction for calculation";
@@ -340,6 +341,7 @@ function loadTexts()
g_modernGraphStyleName = document.getElementById("modernGraphStyleName").innerHTML;
g_RadiusAndDiameter = document.getElementById("RadiusAndDiameter").innerHTML;
g_findShortPathName = document.getElementById("findShortPathName").innerHTML;
g_findShortPathBellmanFordName = document.getElementById("findShortPathBellmanFordName").innerHTML;
g_VerticesDegreeName = document.getElementById("VerticesDegreeName").innerHTML;
g_SpanningTreeResult = document.getElementById("MinSpanningTreeResult").innerHTML;

View File

@@ -533,7 +533,7 @@ Editor.prototype.initAlgorithmList = function()
if (!event.originalEvent.closeThisMenu) {
event.stopPropagation();
}
});
});
$(window).on('click', function() {
$('#algorithmList').slideUp();
});
@@ -644,6 +644,10 @@ Editor.prototype.createAlgorithmMenu = function()
else
{
$(data.object).show();
// Update button text
var textSpan = data.object.getElementsByTagName("span")[1];
textSpan.innerHTML = algorithm.getName();
}
});

View File

@@ -1,5 +1,5 @@
// Global version needs to force reload scripts from server.
let globalVersion = 78;
let globalVersion = 79;
var include = function(filename, localDir) {
return {filename: filename, localDir: localDir};