mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-07 08:16:18 +00:00
Add Emsctipted implementation for algorithm.
This commit is contained in:
@@ -34,7 +34,7 @@ FindEulerianLoop.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("elloop=cgiInput&report=xml", function (pathObjects, properties, results)
|
||||
this.CalculateAlgorithm("elloop", [], function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
}, true);
|
||||
|
||||
@@ -34,7 +34,7 @@ FindEulerianPath.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("elpath=cgiInput&report=xml", function (pathObjects, properties, results)
|
||||
this.CalculateAlgorithm("elpath", [], function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
}, true);
|
||||
|
||||
@@ -46,10 +46,14 @@ FindAllPathes.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("prnpaths=cgiInput&start=" + this.firstObject.id + "&finish=" + this.secondObject.id + "&report=xml", function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
this.CalculateAlgorithm("prnpaths", [
|
||||
{name: "start", value: this.firstObject.id},
|
||||
{name: "finish", value: this.secondObject.id}
|
||||
],
|
||||
function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -46,10 +46,12 @@ FindShortPatchsFromOne.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("blf=cgiInput&start=" + this.firstObject.id + "&report=xml", function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
this.CalculateAlgorithm("blf", [
|
||||
{name: "start", value : this.firstObject.id}
|
||||
], function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -76,19 +76,6 @@ FloidAlgorithm.prototype.result = function(resultCallback)
|
||||
this.app.redrawGraph();
|
||||
|
||||
return result;
|
||||
|
||||
/*
|
||||
if (this.firstObject && this.secondObject)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("dsp=cgiInput&start=" + this.firstObject.id + "&finish=" + this.secondObject.id + "&report=xml", function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ FindHamiltonianLoop.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("hamloop=cgiInput&report=xml", function (pathObjects, properties, results)
|
||||
this.CalculateAlgorithm("hamloop", [], function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
|
||||
@@ -34,7 +34,7 @@ FindHamiltonianPath.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("hampath=cgiInput&report=xml", function (pathObjects, properties, results)
|
||||
this.CalculateAlgorithm("hampath", [], function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
|
||||
@@ -53,7 +53,14 @@ IsomorphismCheck.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("isocheck=cgiInput&graph1=" + this.getGraphEdges(this.firstGraph) + "&graph2=" + this.getGraphEdges(this.secondGraph) + "&report=xml" + (this.searchSubGraphs ? "&searchSubgraphs=true": ""), function (pathObjects, properties, results)
|
||||
var params = [
|
||||
{name : "graph1", value: this.getGraphEdges(this.firstGraph)},
|
||||
{name : "graph2", value: this.getGraphEdges(this.secondGraph)},
|
||||
];
|
||||
if (this.searchSubGraphs) {
|
||||
params.push({name: "searchSubgraphs", value: true});
|
||||
}
|
||||
this.CalculateAlgorithm("isocheck", params, function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
|
||||
@@ -47,10 +47,15 @@ FindMaxFlow.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("mfpr=cgiInput&source=" + this.firstObject.id + "&drain=" + this.secondObject.id + "&report=xml", function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
this.CalculateAlgorithm("mfpr",
|
||||
[
|
||||
{name: "source", value: this.firstObject.id},
|
||||
{name: "drain", value: this.secondObject.id}
|
||||
],
|
||||
function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -43,10 +43,14 @@ FindShortPathNew.prototype.result = function(resultCallback)
|
||||
{
|
||||
this.outResultCallback = function (result ) { resultCallback(result); };
|
||||
self = this;
|
||||
this.CalculateAlgorithm("dsp=cgiInput&start=" + this.firstObject.id + "&finish=" + this.secondObject.id + "&report=xml", function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
this.CalculateAlgorithm("dsp",
|
||||
[
|
||||
{name: "start", value: this.firstObject.id},
|
||||
{name: "finish", value: this.secondObject.id}
|
||||
], function (pathObjects, properties, results)
|
||||
{
|
||||
self.resultCallback(pathObjects, properties, results);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user