Turn on negative edge weight support

This commit is contained in:
Oleg Sh
2024-03-28 21:49:04 +01:00
parent 1adf364131
commit 2e302b9013
21 changed files with 148 additions and 25 deletions

View File

@@ -146,6 +146,12 @@ BaseAlgorithm.prototype.getCategory = function()
return 0;
}
// Algorithm support negative edge weight
BaseAlgorithm.prototype.IsSupportNegativeWeight = function()
{
return false;
}
/**
* Default handler.
* Select using mouse, drag.

View File

@@ -115,6 +115,11 @@ BFSAlgorithm.prototype.IsSupportMultiGraph = function()
return true;
}
BFSAlgorithm.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateBFSAlgorithm(graph, app)
{

View File

@@ -375,6 +375,10 @@ Coloring.prototype.IsSupportMultiGraph = function()
return true;
}
Coloring.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateColoring(graph, app)

View File

@@ -119,6 +119,11 @@ FindConnectedComponentNew.prototype.IsSupportMultiGraph = function()
return true;
}
FindConnectedComponentNew.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateConnectedComponetsNew(graph, app)

View File

@@ -114,6 +114,11 @@ DFSAlgorithm.prototype.IsSupportMultiGraph = function()
return true;
}
DFSAlgorithm.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateDFSAlgorithm(graph, app)
{

View File

@@ -87,6 +87,11 @@ FindEulerianLoop.prototype.getPriority = function()
return -7.5;
}
FindEulerianLoop.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateFindEulerianLoop(graph, app)
{

View File

@@ -87,6 +87,11 @@ FindEulerianPath.prototype.getPriority = function()
return -7.5;
}
FindEulerianPath.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateFindEulerianPath(graph, app)
{

View File

@@ -221,6 +221,10 @@ FindAllPathes.prototype.getPriority = function()
return -9.4;
}
FindAllPathes.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateFindAllPathes(graph, app)

View File

@@ -165,6 +165,11 @@ GraphReorder.prototype.IsSupportMultiGraph = function()
return true;
}
GraphReorder.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateAlgorithmGraphReorder(graph, app)
{

View File

@@ -104,6 +104,11 @@ FindHamiltonianLoop.prototype.IsSupportMultiGraph = function()
return true;
}
FindHamiltonianLoop.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateFindHamiltonianLoop(graph, app)
{

View File

@@ -102,6 +102,11 @@ FindHamiltonianPath.prototype.IsSupportMultiGraph = function()
return true;
}
FindHamiltonianPath.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateFindHamiltonianPath(graph, app)
{

View File

@@ -289,6 +289,11 @@ IsomorphismCheck.prototype.messageWasChanged = function()
}
}
IsomorphismCheck.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateIsomorphismCheck(graph, app)
{

View File

@@ -91,6 +91,11 @@ MaxClique.prototype.getPriority = function()
return -5;
}
MaxClique.prototype.IsSupportNegativeWeight = function()
{
return true;
}
function CreateMaxClique(graph, app)
{
return new MaxClique(graph, app)

View File

@@ -188,6 +188,11 @@ ModernGraphStyle.prototype.IsSupportMultiGraph = function()
return true;
}
ModernGraphStyle.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateAlgorithmModernGraphStyle(graph, app)
{

View File

@@ -221,6 +221,11 @@ RadiusAndDiameter.prototype.IsSupportMultiGraph = function ()
return true;
}
RadiusAndDiameter.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateAlgorithmRadiusAndDiameter(graph, app)
{

View File

@@ -92,6 +92,11 @@ VerticesDegree.prototype.IsSupportMultiGraph = function ()
return true;
}
VerticesDegree.prototype.IsSupportNegativeWeight = function()
{
return true;
}
// Factory for connected components.
function CreateAlgorithmVerticesDegree(graph, app)
{