Support multigraph for algorithms:

- Find all paths.
- Find longest path.
- Find all shortest paths.
This commit is contained in:
Oleg Sh 2025-08-16 13:58:09 +02:00
parent d3416b63b3
commit dfeac352c1
27 changed files with 89 additions and 59 deletions

View File

@ -94,5 +94,5 @@
$g_config['vote'] = "./tmp/vote/vote.txt";
$g_config['voteTopics'] = "./tmp/vote/voteTopics.txt_";
$g_config['use_js_cache'] = true;
$g_config['engine_version'] = 100;
$g_config['engine_version'] = 101;
?>

View File

@ -330,4 +330,5 @@ We have added Dutch translation 🇳🇱. Thank you Willie de Wit</a>";
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -332,4 +332,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -331,4 +331,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -289,4 +289,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -328,4 +328,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -333,4 +333,5 @@ We have added Dutch translation 🇳🇱. Thank you Willie de Wit</a>";
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -332,4 +332,5 @@ Tenemos traducciones en griego 🇬🇷.</a> <a href=\"https://github.com/UnickS
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -299,4 +299,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -296,4 +296,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -332,4 +332,5 @@ Dodaliśmy polskie tłumaczenie, Patryk</a>";
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -297,4 +297,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -287,7 +287,7 @@
$g_lang['use_context_menu'] = "Используйте контекстное меню для дополнительных действий.";
$g_lang['find_longest_path'] = "Поиск самого длинного пути";
$g_lang['length_of_longest_path_from'] = "Длина самого длинного пути ровна ";
$g_lang['length_of_longest_path_from'] = "Длина самого длинного пути равна ";
$g_lang['additionl_actions'] = "Особые действия";
@ -337,4 +337,6 @@
$g_lang['find_all_shortest_pathes'] = "Найти все кратчайшие пути между вершинами";
$g_lang['number_of_shortest_pathes_from'] = "Количество кратчайших путей из ";
$g_lang['length_is'] = "длина равна ";
?>

View File

@ -293,4 +293,5 @@
$g_lang['find_all_shortest_pathes'] = "Find all shortest paths between 2 vertices";
$g_lang['number_of_shortest_pathes_from'] = "Number of shortest paths from ";
$g_lang['length_is'] = "length is ";
?>

View File

@ -335,4 +335,5 @@
$g_lang['find_all_shortest_pathes'] = "Найти все кратчайшие пути между вершинами";
$g_lang['number_of_shortest_pathes_from'] = "Количество кратчайших путей из ";
$g_lang['length_is'] = "длина равна ";
?>

View File

@ -110,13 +110,11 @@ FindAllPathes.prototype.resultCallback = function(pathObjects, properties, resul
}
var subGraphIndex = 0;
var prevNodeId = -1;
for (var i = 0; i < results.length; i++)
{
if (results[i].type == 6)
{
subGraphIndex++;
prevNodeId = -1;
}
if (results[i].type == 4)
@ -126,14 +124,15 @@ FindAllPathes.prototype.resultCallback = function(pathObjects, properties, resul
var subgGraph = this.foundSubGraphs[index];
subgGraph[nodeId] = true;
this.foundPaths[index].push(nodeId);
if (prevNodeId >= 0)
{
var edgeObject = this.graph.FindEdgeMin(prevNodeId, nodeId);
subgGraph[edgeObject.id] = true;
}
prevNodeId = nodeId;
this.foundPaths[index].push(nodeId);
}
if (results[i].type == 5)
{
var edgeId = parseInt(results[i].value);
var index = subGraphIndex;
var subgGraph = this.foundSubGraphs[index];
subgGraph[edgeId] = true;
}
}
@ -226,6 +225,11 @@ FindAllPathes.prototype.IsSupportNegativeWeight = function()
return true;
}
FindAllPathes.prototype.IsSupportMultiGraph = function()
{
return true;
}
// Factory for connected components.
function CreateFindAllPathes(graph, app)
{

View File

@ -11,6 +11,7 @@ function FindAllShortestPathes(graph, app)
this.nSubgraphIndex = 0;
this.nSubGraphCount = 0;
this.foundPaths = {};
this.min_len = 1E10;
}
@ -50,6 +51,8 @@ FindAllShortestPathes.prototype.result = function(resultCallback)
{
if (this.firstObject && this.secondObject)
{
this.min_len = 1E10;
this.outResultCallback = function (result ) { resultCallback(result); };
self = this;
this.CalculateAlgorithm("prnpaths", [
@ -77,7 +80,7 @@ FindAllShortestPathes.prototype.setResultMessage = function()
this.message = g_numberOfShortestPathesFrom + this.firstObject.mainText +
g_to + this.secondObject.mainText + g_are +
this.nSubGraphCount + ". " + g_pathN + (1 + parseInt(this.nSubgraphIndex)) + ": " + currentPath +
this.nSubGraphCount + " (" + g_length_is + this.min_len + ")" +". " + g_pathN + (1 + parseInt(this.nSubgraphIndex)) + ": " + currentPath +
" <select style=\"float:right\" id=\"enumSubgraphs\"></select>";
}
else
@ -100,14 +103,12 @@ FindAllShortestPathes.prototype.resultCallback = function(pathObjects, propertie
if (bFound)
{
let patches_len = {};
let min_len = 1E10;
// Search minimal patches
{
let current_len = 0;
var subGraphIndex = 0;
var prevNodeId = -1;
let any_found = false;
for (var i = 0; i < results.length; i++)
{
@ -115,35 +116,28 @@ FindAllShortestPathes.prototype.resultCallback = function(pathObjects, propertie
{
patches_len[subGraphIndex] = current_len;
subGraphIndex++;
prevNodeId = -1;
min_len = Math.min(min_len, current_len);
this.min_len = Math.min(this.min_len, current_len);
current_len = 0;
}
if (results[i].type == 4)
if (results[i].type == 5)
{
any_found = true;
var nodeId = parseInt(results[i].value);
var index = subGraphIndex;
if (prevNodeId >= 0)
{
var edgeObject = this.graph.FindEdgeMin(prevNodeId, nodeId);
current_len = current_len + edgeObject.GetWeight();
}
prevNodeId = nodeId;
var edgeId = parseInt(results[i].value);
let edgeObject = this.graph.FindEdgeById(edgeId);
current_len = current_len + edgeObject.GetWeight();
}
}
if (any_found)
{
patches_len[subGraphIndex] = current_len;
min_len = Math.min(min_len, current_len);
this.min_len = Math.min(this.min_len, current_len);
}
}
let min_pathes_count = 0;
for (const [key, value] of Object.entries(patches_len)) {
if (value == min_len)
if (value == this.min_len)
{
min_pathes_count = min_pathes_count + 1;
}
@ -160,17 +154,20 @@ FindAllShortestPathes.prototype.resultCallback = function(pathObjects, propertie
}
var subGraphIndex = 0;
var prevNodeId = -1;
let skipGraphsCount = patches_len[subGraphIndex] > this.min_len ? 1 : 0;
for (var i = 0; i < results.length; i++)
{
if (results[i].type == 6)
{
subGraphIndex++;
prevNodeId = -1;
}
if (patches_len[subGraphIndex] > min_len)
if (patches_len[subGraphIndex] > this.min_len)
{
if (results[i].type == 6)
{
skipGraphsCount++;
}
// Skip
continue;
}
@ -178,18 +175,18 @@ FindAllShortestPathes.prototype.resultCallback = function(pathObjects, propertie
if (results[i].type == 4)
{
var nodeId = parseInt(results[i].value);
var index = subGraphIndex;
var index = subGraphIndex - skipGraphsCount;
var subgGraph = this.foundSubGraphs[index];
subgGraph[nodeId] = true;
this.foundPaths[index].push(nodeId);
if (prevNodeId >= 0)
{
var edgeObject = this.graph.FindEdgeMin(prevNodeId, nodeId);
subgGraph[edgeObject.id] = true;
}
prevNodeId = nodeId;
}
if (results[i].type == 5)
{
var index = subGraphIndex - skipGraphsCount;
var subgGraph = this.foundSubGraphs[index];
var edgeId = parseInt(results[i].value);
subgGraph[edgeId] = true;
}
}
@ -258,6 +255,7 @@ FindAllShortestPathes.prototype.deselectAll = function()
this.nSubgraphIndex = 0;
this.nSubGraphCount = 0;
this.message = g_selectStartVertex;
return true;
}
@ -282,6 +280,11 @@ FindAllShortestPathes.prototype.IsSupportNegativeWeight = function()
return true;
}
FindAllShortestPathes.prototype.IsSupportMultiGraph = function()
{
return true;
}
// Factory for connected components.
function CreateFindAllShortestPathes(graph, app)
{

View File

@ -113,7 +113,6 @@ FindLongestPath.prototype.resultCallback = function(pathObjects, properties, res
}
var subGraphIndex = 0;
var prevNodeId = -1;
for (var i = 0; i < results.length; i++)
{
if (results[i].type == 6)
@ -124,7 +123,6 @@ FindLongestPath.prototype.resultCallback = function(pathObjects, properties, res
}
currentLength = 0;
subGraphIndex++;
prevNodeId = -1;
}
if (results[i].type == 4)
@ -135,14 +133,16 @@ FindLongestPath.prototype.resultCallback = function(pathObjects, properties, res
subgGraph[nodeId] = true;
this.foundPaths[index].push(nodeId);
if (prevNodeId >= 0)
{
var edgeObject = this.graph.FindEdgeMax(prevNodeId, nodeId);
subgGraph[edgeObject.id] = true;
currentLength += edgeObject.GetWeight();
}
prevNodeId = nodeId;
}
if (results[i].type == 5)
{
var edgeId = parseInt(results[i].value);
var index = subGraphIndex;
var subgGraph = this.foundSubGraphs[index];
subgGraph[edgeId] = true;
let edgeObject = this.graph.FindEdgeById(edgeId);
currentLength += edgeObject.GetWeight();
}
}
if (currentLength > this.maxPathLength) {
@ -223,6 +223,11 @@ FindLongestPath.prototype.IsSupportNegativeWeight = function()
return true;
}
FindLongestPath.prototype.IsSupportMultiGraph = function()
{
return true;
}
// Factory for connected components.
function CreateFindLongestPath(graph, app)
{

View File

@ -66,7 +66,7 @@ FindShortPatchsFromOne.prototype.setResultMessage = function()
if (this.nSubGraphCount > 0)
{
this.message = g_distanceFrom + this.firstObject.mainText +
g_to + this.lastVertexInPath[this.nSubgraphIndex] + g_are +
g_to + this.lastVertexInPath[this.nSubgraphIndex] + g_are +
this.lengthOfPath[this.nSubgraphIndex] + " <select style=\"float:right\" id=\"enumSubgraphs\"></select>";
}
else

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=100","/script/shared/point.js?v=100","/script/entities/edge/api/index.js?v=100","/script/entities/edge/model/BaseEdge.js?v=100","/script/entities/edge/model/EdgeModel.js?v=100","/script/entities/vertex/api/index.js?v=100","/script/entities/vertex/model/BaseVertex.js?v=100","/script/entities/vertex/model/VertexModel.js?v=100","/script/entities/graph/model/Graph.js?v=100",]);{let modulDir="pages/create_graph_by_edge_list/";doInclude([include("entities/graph/api/index.js")]);}
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=101","/script/shared/point.js?v=101","/script/entities/edge/api/index.js?v=101","/script/entities/edge/model/BaseEdge.js?v=101","/script/entities/edge/model/EdgeModel.js?v=101","/script/entities/vertex/api/index.js?v=101","/script/entities/vertex/model/BaseVertex.js?v=101","/script/entities/vertex/model/VertexModel.js?v=101","/script/entities/graph/model/Graph.js?v=101",]);{let modulDir="pages/create_graph_by_edge_list/";doInclude([include("entities/graph/api/index.js")]);}
{let modulDir="entities/graph/";doInclude([include("shared/point.js"),include("entities/edge/api/index.js"),include("entities/vertex/api/index.js"),include("model/Graph.js",modulDir)])}function Point(x,y){this.x=x||0;this.y=y||0;};Point.prototype.x=null;Point.prototype.y=null;Point.prototype.add=function(v){return new Point(this.x+v.x,this.y+v.y);};Point.prototype.addValue=function(v){return new Point(this.x+v,this.y+v);};Point.prototype.clone=function(){return new Point(this.x,this.y);};Point.prototype.degreesTo=function(v){var dx=this.x-v.x;var dy=this.y-v.y;var angle=Math.atan2(dy,dx);return angle*(180/Math.PI);};Point.prototype.distance=function(v){return Math.sqrt(this.distanceSqr(v));};Point.prototype.distanceSqr=function(v){var x=this.x-v.x;var y=this.y-v.y;return x*x+y*y;};Point.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y;};Point.prototype.interpolate=function(v,f){return new Point((this.x+v.x)*f,(this.y+v.y)*f);};Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y);};Point.prototype.normalize=function(thickness){var l=this.length();this.x=this.x/l*thickness;this.y=this.y/l*thickness;return new Point(this.x,this.y);};Point.prototype.normalizeCopy=function(thickness){var l=this.length();return new Point(this.x/l*thickness,this.y/l*thickness);};Point.prototype.orbit=function(origin,arcWidth,arcHeight,degrees){var radians=degrees*(Math.PI/180);this.x=origin.x+arcWidth*Math.cos(radians);this.y=origin.y+arcHeight*Math.sin(radians);};Point.prototype.rotate=function(center,degrees){var radians=degrees*(Math.PI/180);offset=this.subtract(center);this.x=offset.x*Math.cos(radians)-offset.y*Math.sin(radians);this.y=offset.x*Math.sin(radians)+offset.y*Math.cos(radians);this.x=this.x+center.x;this.y=this.y+center.y;return this;};Point.prototype.offset=function(dx,dy){this.x+=dx;this.y+=dy;};Point.prototype.subtract=function(v){return new Point(this.x-v.x,this.y-v.y);};Point.prototype.subtractValue=function(value){return new Point(this.x-value,this.y-value);};Point.prototype.multiply=function(value){return new Point(this.x*value,this.y*value);};Point.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")";};Point.prototype.normal=function(){return new Point(-this.y,this.x);};Point.prototype.min=function(point)
{return new Point(Math.min(this.x,point.x),Math.min(this.y,point.y));};Point.prototype.max=function(point)
{return new Point(Math.max(this.x,point.x),Math.max(this.y,point.y));};Point.prototype.inverse=function()

View File

@ -1,4 +1,4 @@
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=100","/script/shared/point.js?v=100","/script/entities/edge/api/index.js?v=100","/script/entities/edge/model/BaseEdge.js?v=100","/script/entities/edge/model/EdgeModel.js?v=100","/script/entities/vertex/api/index.js?v=100","/script/entities/vertex/model/BaseVertex.js?v=100","/script/entities/vertex/model/VertexModel.js?v=100","/script/entities/graph/model/Graph.js?v=100",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js")]);}
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=101","/script/shared/point.js?v=101","/script/entities/edge/api/index.js?v=101","/script/entities/edge/model/BaseEdge.js?v=101","/script/entities/edge/model/EdgeModel.js?v=101","/script/entities/vertex/api/index.js?v=101","/script/entities/vertex/model/BaseVertex.js?v=101","/script/entities/vertex/model/VertexModel.js?v=101","/script/entities/graph/model/Graph.js?v=101",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js")]);}
{let modulDir="entities/graph/";doInclude([include("shared/point.js"),include("entities/edge/api/index.js"),include("entities/vertex/api/index.js"),include("model/Graph.js",modulDir)])}function Point(x,y){this.x=x||0;this.y=y||0;};Point.prototype.x=null;Point.prototype.y=null;Point.prototype.add=function(v){return new Point(this.x+v.x,this.y+v.y);};Point.prototype.addValue=function(v){return new Point(this.x+v,this.y+v);};Point.prototype.clone=function(){return new Point(this.x,this.y);};Point.prototype.degreesTo=function(v){var dx=this.x-v.x;var dy=this.y-v.y;var angle=Math.atan2(dy,dx);return angle*(180/Math.PI);};Point.prototype.distance=function(v){return Math.sqrt(this.distanceSqr(v));};Point.prototype.distanceSqr=function(v){var x=this.x-v.x;var y=this.y-v.y;return x*x+y*y;};Point.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y;};Point.prototype.interpolate=function(v,f){return new Point((this.x+v.x)*f,(this.y+v.y)*f);};Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y);};Point.prototype.normalize=function(thickness){var l=this.length();this.x=this.x/l*thickness;this.y=this.y/l*thickness;return new Point(this.x,this.y);};Point.prototype.normalizeCopy=function(thickness){var l=this.length();return new Point(this.x/l*thickness,this.y/l*thickness);};Point.prototype.orbit=function(origin,arcWidth,arcHeight,degrees){var radians=degrees*(Math.PI/180);this.x=origin.x+arcWidth*Math.cos(radians);this.y=origin.y+arcHeight*Math.sin(radians);};Point.prototype.rotate=function(center,degrees){var radians=degrees*(Math.PI/180);offset=this.subtract(center);this.x=offset.x*Math.cos(radians)-offset.y*Math.sin(radians);this.y=offset.x*Math.sin(radians)+offset.y*Math.cos(radians);this.x=this.x+center.x;this.y=this.y+center.y;return this;};Point.prototype.offset=function(dx,dy){this.x+=dx;this.y+=dy;};Point.prototype.subtract=function(v){return new Point(this.x-v.x,this.y-v.y);};Point.prototype.subtractValue=function(value){return new Point(this.x-value,this.y-value);};Point.prototype.multiply=function(value){return new Point(this.x*value,this.y*value);};Point.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")";};Point.prototype.normal=function(){return new Point(-this.y,this.x);};Point.prototype.min=function(point)
{return new Point(Math.min(this.x,point.x),Math.min(this.y,point.y));};Point.prototype.max=function(point)
{return new Point(Math.max(this.x,point.x),Math.max(this.y,point.y));};Point.prototype.inverse=function()

View File

@ -1,4 +1,4 @@
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=100","/script/shared/point.js?v=100","/script/entities/edge/api/index.js?v=100","/script/entities/edge/model/BaseEdge.js?v=100","/script/entities/edge/model/EdgeModel.js?v=100","/script/entities/vertex/api/index.js?v=100","/script/entities/vertex/model/BaseVertex.js?v=100","/script/entities/vertex/model/VertexModel.js?v=100","/script/entities/graph/model/Graph.js?v=100","/script/pages/create_graph_by_matrix/model/createByMatrixMain.js?v=100","/script/pages/create_graph_by_matrix/model/main.js?v=100",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js"),include("model/createByMatrixMain.js",modulDir),include("model/main.js",modulDir)]);}
moduleLoader.beginCacheLoading(["/script/entities/graph/api/index.js?v=101","/script/shared/point.js?v=101","/script/entities/edge/api/index.js?v=101","/script/entities/edge/model/BaseEdge.js?v=101","/script/entities/edge/model/EdgeModel.js?v=101","/script/entities/vertex/api/index.js?v=101","/script/entities/vertex/model/BaseVertex.js?v=101","/script/entities/vertex/model/VertexModel.js?v=101","/script/entities/graph/model/Graph.js?v=101","/script/pages/create_graph_by_matrix/model/createByMatrixMain.js?v=101","/script/pages/create_graph_by_matrix/model/main.js?v=101",]);{let modulDir="pages/create_graph_by_matrix/";doInclude([include("entities/graph/api/index.js"),include("model/createByMatrixMain.js",modulDir),include("model/main.js",modulDir)]);}
{let modulDir="entities/graph/";doInclude([include("shared/point.js"),include("entities/edge/api/index.js"),include("entities/vertex/api/index.js"),include("model/Graph.js",modulDir)])}function Point(x,y){this.x=x||0;this.y=y||0;};Point.prototype.x=null;Point.prototype.y=null;Point.prototype.add=function(v){return new Point(this.x+v.x,this.y+v.y);};Point.prototype.addValue=function(v){return new Point(this.x+v,this.y+v);};Point.prototype.clone=function(){return new Point(this.x,this.y);};Point.prototype.degreesTo=function(v){var dx=this.x-v.x;var dy=this.y-v.y;var angle=Math.atan2(dy,dx);return angle*(180/Math.PI);};Point.prototype.distance=function(v){return Math.sqrt(this.distanceSqr(v));};Point.prototype.distanceSqr=function(v){var x=this.x-v.x;var y=this.y-v.y;return x*x+y*y;};Point.prototype.equals=function(toCompare){return this.x==toCompare.x&&this.y==toCompare.y;};Point.prototype.interpolate=function(v,f){return new Point((this.x+v.x)*f,(this.y+v.y)*f);};Point.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y);};Point.prototype.normalize=function(thickness){var l=this.length();this.x=this.x/l*thickness;this.y=this.y/l*thickness;return new Point(this.x,this.y);};Point.prototype.normalizeCopy=function(thickness){var l=this.length();return new Point(this.x/l*thickness,this.y/l*thickness);};Point.prototype.orbit=function(origin,arcWidth,arcHeight,degrees){var radians=degrees*(Math.PI/180);this.x=origin.x+arcWidth*Math.cos(radians);this.y=origin.y+arcHeight*Math.sin(radians);};Point.prototype.rotate=function(center,degrees){var radians=degrees*(Math.PI/180);offset=this.subtract(center);this.x=offset.x*Math.cos(radians)-offset.y*Math.sin(radians);this.y=offset.x*Math.sin(radians)+offset.y*Math.cos(radians);this.x=this.x+center.x;this.y=this.y+center.y;return this;};Point.prototype.offset=function(dx,dy){this.x+=dx;this.y+=dy;};Point.prototype.subtract=function(v){return new Point(this.x-v.x,this.y-v.y);};Point.prototype.subtractValue=function(value){return new Point(this.x-value,this.y-value);};Point.prototype.multiply=function(value){return new Point(this.x*value,this.y*value);};Point.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")";};Point.prototype.normal=function(){return new Point(-this.y,this.x);};Point.prototype.min=function(point)
{return new Point(Math.min(this.x,point.x),Math.min(this.y,point.y));};Point.prototype.max=function(point)
{return new Point(Math.max(this.x,point.x),Math.max(this.y,point.y));};Point.prototype.inverse=function()

File diff suppressed because one or more lines are too long

View File

@ -220,6 +220,7 @@ var g_MaxIndependentSetContains = ". Set contains these vertecies: ";
var g_FindAllShortestPathes = "Find all shortest paths";
var g_numberOfShortestPathesFrom = "Number of shortest paths from ";
var g_length_is = "length is ";
function loadTexts()
{
@ -449,4 +450,5 @@ function loadTexts()
g_FindAllShortestPathes = document.getElementById("findAllShortestPathes").innerHTML;
g_numberOfShortestPathesFrom = document.getElementById("numberOfShortestPathesFrom").innerHTML;
g_length_is = document.getElementById("lengthIs").innerHTML;
}

View File

@ -990,6 +990,7 @@
<p id="findAllShortestPathes" class="translation"><?= L('find_all_shortest_pathes')?></p>
<p id="numberOfShortestPathesFrom" class="translation"><?= L('number_of_shortest_pathes_from')?></p>
<p id="lengthIs" class="translation"><?= L('length_is')?></p>
</section>
<script src="<?= RootCacheJS("script/pages/editor/api/index.js")?>" ></script>