=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"a":___assert_fail,"c":___cxa_allocate_exception,"b":___cxa_throw,"e":___syscall_fcntl64,"j":___syscall_ioctl,"k":___syscall_open,"g":_abort,"m":_emscripten_memcpy_big,"n":_emscripten_resize_heap,"p":_environ_get,"h":_environ_sizes_get,"f":_fd_close,"i":_fd_read,"l":_fd_seek,"d":_fd_write,"o":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["r"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["t"]).apply(null,arguments)};var _ProcessAlgorithm=Module["_ProcessAlgorithm"]=function(){return(_ProcessAlgorithm=Module["_ProcessAlgorithm"]=Module["asm"]["u"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["v"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["w"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["x"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["y"]).apply(null,arguments)};Module["ccall"]=ccall;Module["cwrap"]=cwrap;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();
diff --git a/script/Graphoffline.Emscripten.wasm b/script/Graphoffline.Emscripten.wasm
index 25af944..5556f3b 100644
Binary files a/script/Graphoffline.Emscripten.wasm and b/script/Graphoffline.Emscripten.wasm differ
diff --git a/script/plugins/MaxClique.js b/script/plugins/MaxClique.js
new file mode 100644
index 0000000..f462e36
--- /dev/null
+++ b/script/plugins/MaxClique.js
@@ -0,0 +1,100 @@
+/**
+ * Find Eulerian Loop.
+ *
+ */
+function MaxClique(graph, app)
+{
+ BaseAlgorithmEx.apply(this, arguments);
+ this.message = g_processing;
+ this.selectedObjects = [];
+}
+
+
+// inheritance.
+MaxClique.prototype = Object.create(BaseAlgorithmEx.prototype);
+
+
+MaxClique.prototype.getName = function(local)
+{
+ return g_MaxClique;
+}
+
+MaxClique.prototype.getId = function()
+{
+ return "OlegSh.MaxClique";
+}
+
+// @return message for user.
+MaxClique.prototype.getMessage = function(local)
+{
+ return this.message;
+}
+
+MaxClique.prototype.result = function(resultCallback)
+{
+ this.outResultCallback = function (result ) { resultCallback(result); };
+ self = this;
+ this.CalculateAlgorithm("mc", [], function (pathObjects, properties, results)
+ {
+ self.resultCallback(pathObjects, properties, results);
+ });
+
+ return true;
+}
+
+MaxClique.prototype.resultCallback = function(pathObjects, properties, results)
+{
+ result = results.length > 0 && results[0].value > 0 && results[0].type == 1;
+
+ var outputResult = {};
+ outputResult["version"] = 1;
+
+ console.log("properties");
+ console.log(properties);
+ console.log("results");
+ console.log(results);
+ console.log("pathObjects");
+ console.log(pathObjects);
+
+ this.message = result > 0 ? "" : g_MaxCliqueNotFound;
+ if (result > 0)
+ {
+ let size = results[0].value;
+ this.message = g_MaxCliqueSizeIs + size;
+
+ this.selectedObjects = [];
+
+ this.message = this.message + g_MaxCliqueContains;
+
+ var vertexIndex = 0;
+ for (var i = 0; i < pathObjects.length; i++)
+ {
+ let object = pathObjects[i];
+ if (object instanceof BaseVertex) {
+ this.message = this.message + object.mainText + ((vertexIndex < size - 1) ? ", " : ".");
+ vertexIndex++;
+ }
+ this.selectedObjects[object.id] = 1;
+ }
+ }
+
+ this.outResultCallback(outputResult);
+}
+
+MaxClique.prototype.getObjectSelectedGroup = function(object)
+{
+ return (object.id in this.selectedObjects) ? this.selectedObjects[object.id] : 0;
+}
+
+MaxClique.prototype.getPriority = function()
+{
+ return -5;
+}
+
+function CreateMaxClique(graph, app)
+{
+ return new MaxClique(graph, app)
+}
+
+// Gerister connected component.
+RegisterAlgorithm (CreateMaxClique);
diff --git a/script/texts.js b/script/texts.js
index 290e443..ded048c 100644
--- a/script/texts.js
+++ b/script/texts.js
@@ -198,6 +198,11 @@ var g_makeAllDirected = "Make all edges directed";
var g_reuseSavedEdge = "Reuse saved edge";
+var g_MaxClique = "Max Clique";
+var g_MaxCliqueNotFound = "Max Clique is not found";
+var g_MaxCliqueSizeIs = "Max Clique size is ";
+var g_MaxCliqueContains = ". Clique contains these vertecies: ";
+
function loadTexts()
{
g_textsSelectAndMove = document.getElementById("SelectAndMoveObject").innerHTML;
@@ -404,4 +409,9 @@ function loadTexts()
g_fix = document.getElementById("fixButton").innerHTML;
g_reuseSavedEdge = document.getElementById("reuseSavedEdge").innerHTML;
+
+ g_MaxClique = document.getElementById("maxClique").innerHTML;
+ g_MaxCliqueNotFound = document.getElementById("maxCliqueNotFound").innerHTML;
+ g_MaxCliqueSizeIs = document.getElementById("maxCliqueSizeIs").innerHTML;
+ g_MaxCliqueContains = document.getElementById("maxCliqueContains").innerHTML;
}
diff --git a/tpl/home.php b/tpl/home.php
index 897363d..ea7745f 100755
--- a/tpl/home.php
+++ b/tpl/home.php
@@ -11,7 +11,7 @@
-
+
@@ -866,7 +866,12 @@
= L('edge_list_wrong_format')?>
= L('fix_button')?>
= L('reuse_saved_edge')?>
-
+
+ = L('max_clique')?>
+ = L('max_clique_not_found')?>
+ = L('max_clique_size_is')?>
+ = L('max_clique_contains')?>
+