330 lines
26 KiB
HTML
330 lines
26 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>OR-Tools</title>
|
|
<meta http-equiv="Content-Type" content="text/html;"/>
|
|
<meta charset="utf-8"/>
|
|
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
|
|
<link rel="stylesheet" type="text/css" href="ortools.css" title="default" media="screen,print" />
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="banner-container">
|
|
<div id="banner">
|
|
<span id="sfml">OR-Tools 7.2</span>
|
|
</div>
|
|
</div>
|
|
<link rel="icon" href="https://developers.google.com/optimization/images/orLogo.png">
|
|
<div id="content">
|
|
<!-- Generated by Doxygen 1.8.15 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="navrow2" class="tabs2">
|
|
<ul class="tablist">
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="classes.html"><span>Class Index</span></a></li>
|
|
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="namespaceoperations__research.html">operations_research</a></li><li class="navelem"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">BronKerboschAlgorithm</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#nested-classes">Classes</a> |
|
|
<a href="#pub-types">Public Types</a> |
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classoperations__research_1_1BronKerboschAlgorithm-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">operations_research::BronKerboschAlgorithm< NodeIndex > Class Template Reference</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
|
|
<p>Implements the Bron-Kerbosch algorithm for finding maximal cliques.
|
|
<a href="classoperations__research_1_1BronKerboschAlgorithm.html#details">More...</a></p>
|
|
|
|
<p><code>#include <<a class="el" href="cliques_8h_source.html">cliques.h</a>></code></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
|
|
Public Types</h2></td></tr>
|
|
<tr class="memitem:a2c635d9b0b40012abf93606dd023e535"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#a2c635d9b0b40012abf93606dd023e535">IsArcCallback</a> = std::function< bool(<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>)></td></tr>
|
|
<tr class="memdesc:a2c635d9b0b40012abf93606dd023e535"><td class="mdescLeft"> </td><td class="mdescRight">A callback called by the algorithm to test if there is an arc between a pair of nodes. <a href="#a2c635d9b0b40012abf93606dd023e535">More...</a><br /></td></tr>
|
|
<tr class="separator:a2c635d9b0b40012abf93606dd023e535"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ae49289c12a088e9f15bb26f927406c2f"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#ae49289c12a088e9f15bb26f927406c2f">CliqueCallback</a> = std::function< <a class="el" href="namespaceoperations__research.html#af2d89e69d073dc3036a6de24710b416f">CliqueResponse</a>(const std::vector< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> > &)></td></tr>
|
|
<tr class="memdesc:ae49289c12a088e9f15bb26f927406c2f"><td class="mdescLeft"> </td><td class="mdescRight">A callback called by the algorithm to report a maximal clique to the user. <a href="#ae49289c12a088e9f15bb26f927406c2f">More...</a><br /></td></tr>
|
|
<tr class="separator:ae49289c12a088e9f15bb26f927406c2f"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:ae7ca5a1b7767ea98c2f337e8b6f94c44"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#ae7ca5a1b7767ea98c2f337e8b6f94c44">BronKerboschAlgorithm</a> (<a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#a2c635d9b0b40012abf93606dd023e535">IsArcCallback</a> is_arc, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> num_nodes, <a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#ae49289c12a088e9f15bb26f927406c2f">CliqueCallback</a> clique_callback)</td></tr>
|
|
<tr class="memdesc:ae7ca5a1b7767ea98c2f337e8b6f94c44"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the Bron-Kerbosch algorithm for the given graph and clique callback function. <a href="#ae7ca5a1b7767ea98c2f337e8b6f94c44">More...</a><br /></td></tr>
|
|
<tr class="separator:ae7ca5a1b7767ea98c2f337e8b6f94c44"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6dcb077f31531cc17c94da3364b6f099"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#a6dcb077f31531cc17c94da3364b6f099">Run</a> ()</td></tr>
|
|
<tr class="memdesc:a6dcb077f31531cc17c94da3364b6f099"><td class="mdescLeft"> </td><td class="mdescRight">Runs the Bron-Kerbosch algorithm for kint64max iterations. <a href="#a6dcb077f31531cc17c94da3364b6f099">More...</a><br /></td></tr>
|
|
<tr class="separator:a6dcb077f31531cc17c94da3364b6f099"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a14b12a4c5ea291009f47c1a98c458f81"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#a14b12a4c5ea291009f47c1a98c458f81">RunIterations</a> (int64 max_num_iterations)</td></tr>
|
|
<tr class="memdesc:a14b12a4c5ea291009f47c1a98c458f81"><td class="mdescLeft"> </td><td class="mdescRight">Runs at most 'max_num_iterations' iterations of the Bron-Kerbosch algorithm. <a href="#a14b12a4c5ea291009f47c1a98c458f81">More...</a><br /></td></tr>
|
|
<tr class="separator:a14b12a4c5ea291009f47c1a98c458f81"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa28a934535a824fa63672b6c314b61cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#aa28a934535a824fa63672b6c314b61cc">RunWithTimeLimit</a> (int64 max_num_iterations, TimeLimit *time_limit)</td></tr>
|
|
<tr class="memdesc:aa28a934535a824fa63672b6c314b61cc"><td class="mdescLeft"> </td><td class="mdescRight">Runs at most 'max_num_iterations' iterations of the Bron-Kerbosch algorithm, until the time limit is exceeded or until all cliques are enumerated. <a href="#aa28a934535a824fa63672b6c314b61cc">More...</a><br /></td></tr>
|
|
<tr class="separator:aa28a934535a824fa63672b6c314b61cc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a4a1ea40849bc5e92cecec1a90f2f2bb9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#a4a1ea40849bc5e92cecec1a90f2f2bb9">RunWithTimeLimit</a> (TimeLimit *time_limit)</td></tr>
|
|
<tr class="memdesc:a4a1ea40849bc5e92cecec1a90f2f2bb9"><td class="mdescLeft"> </td><td class="mdescRight">Runs the Bron-Kerbosch algorithm for at most kint64max iterations, until the time limit is excceded or until all cliques are enumerated. <a href="#a4a1ea40849bc5e92cecec1a90f2f2bb9">More...</a><br /></td></tr>
|
|
<tr class="separator:a4a1ea40849bc5e92cecec1a90f2f2bb9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><h3>template<typename NodeIndex><br />
|
|
class operations_research::BronKerboschAlgorithm< NodeIndex ></h3>
|
|
|
|
<p>Implements the Bron-Kerbosch algorithm for finding maximal cliques. </p>
|
|
<p>The graph is represented as a callback that gets two nodes as its arguments and it returns true if and only if there is an arc between the two nodes. The cliques are reported back to the user using a second callback.</p>
|
|
<p>Typical usage: auto graph = [](int node1, int node2) { return true; }; auto on_clique = [](const std::vector<int>& clique) { LOG(INFO) << "Clique!"; };</p>
|
|
<p>BronKerboschAlgorithm<int> bron_kerbosch(graph, num_nodes, on_clique); bron_kerbosch.Run();</p>
|
|
<p>or:</p>
|
|
<p><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html" title="Implements the Bron-Kerbosch algorithm for finding maximal cliques.">BronKerboschAlgorithm</a> bron_kerbosch(graph, num_nodes, clique); bron_kerbosch.RunIterations(kMaxNumIterations);</p>
|
|
<p>This is a non-recursive implementation of the Bron-Kerbosch algorithm with pivots as described in the paper by Bron and Kerbosch (1973) (the version 2 algorithm in the paper). The basic idea of the algorithm is to incrementally build the cliques using depth-first search. During the search, the algorithm maintains two sets of candidates (nodes that are connected to all nodes in the current clique):</p><ul>
|
|
<li>the "not" set - these are candidates that were already visited by the search and all the maximal cliques that contain them as a part of the current clique were already reported.</li>
|
|
<li>the actual candidates - these are candidates that were not visited yet, and they can be added to the clique. In each iteration, the algorithm does the first of the following actions that applies: A. If there are no actual candidates and there are candidates in the "not" set, or if all actual candidates are connected to the same node in the "not" set, the current clique can't be extended to a maximal clique that was not already reported. Return from the recursive call and move the selected candidate to the set "not". B. If there are no candidates at all, it means that the current clique can't be extended and that it is in fact a maximal clique. Report it to the user and return from the recursive call. Move the selected candidate to the set "not". C. Otherwise, there are actual candidates, extend the current clique with one of these candidates and process it recursively.</li>
|
|
</ul>
|
|
<p>To avoid unnecessary steps, the algorithm selects a pivot at each level of the recursion to guide the selection of candidates added to the current clique. The pivot can be either in the "not" set and among the actual candidates. The algorithm tries to move the pivot and all actual candidates connected to it to the set "not" as quickly as possible. This will fulfill the conditions of step A, and the search algorithm will be able to leave the current branch. Selecting a pivot that has the lowest number of disconnected nodes among the candidates can reduce the running time significantly.</p>
|
|
<p>The worst-case maximal depth of the recursion is equal to the number of nodes in the graph, which makes the natural recursive implementation impractical for nodes with more than a few thousands of nodes. To avoid the limitation, this class simulates the recursion by maintaining a stack with the state at each level of the recursion. The algorithm then runs in a loop. In each iteration, the algorithm can do one or both of:</p><ol type="1">
|
|
<li>Return to the previous recursion level (step A or B of the algorithm) by removing the top state from the stack.</li>
|
|
<li>Select the next candidate and enter the next recursion level (step C of the algorithm) by adding a new state to the stack.</li>
|
|
</ol>
|
|
<p>The worst-case time complexity of the algorithm is O(3^(N/3)), and the memory complexity is O(N^2), where N is the number of nodes in the graph. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00143">143</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
</div><h2 class="groupheader">Member Typedef Documentation</h2>
|
|
<a id="ae49289c12a088e9f15bb26f927406c2f"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae49289c12a088e9f15bb26f927406c2f">◆ </a></span>CliqueCallback</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename NodeIndex > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">using <a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">operations_research::BronKerboschAlgorithm</a>< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> >::<a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#ae49289c12a088e9f15bb26f927406c2f">CliqueCallback</a> = std::function<<a class="el" href="namespaceoperations__research.html#af2d89e69d073dc3036a6de24710b416f">CliqueResponse</a>(const std::vector<<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>>&)></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>A callback called by the algorithm to report a maximal clique to the user. </p>
|
|
<p>The clique is returned as a list of nodes in the clique, in no particular order. The caller must make a copy of the vector if they want to keep the nodes.</p>
|
|
<p>The return value of the callback controls how the algorithm continues after this clique. See the description of the values of 'CliqueResponse' for more details. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00159">159</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2c635d9b0b40012abf93606dd023e535"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2c635d9b0b40012abf93606dd023e535">◆ </a></span>IsArcCallback</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename NodeIndex > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">using <a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">operations_research::BronKerboschAlgorithm</a>< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> >::<a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#a2c635d9b0b40012abf93606dd023e535">IsArcCallback</a> = std::function<bool(<a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>, <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a>)></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>A callback called by the algorithm to test if there is an arc between a pair of nodes. </p>
|
|
<p>The callback must return true if and only if there is an arc. Note that to function properly, the function must be symmetrical (represent an undirected graph). </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00149">149</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="ae7ca5a1b7767ea98c2f337e8b6f94c44"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae7ca5a1b7767ea98c2f337e8b6f94c44">◆ </a></span>BronKerboschAlgorithm()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename NodeIndex > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">operations_research::BronKerboschAlgorithm</a>< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> >::<a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">BronKerboschAlgorithm</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#a2c635d9b0b40012abf93606dd023e535">IsArcCallback</a> </td>
|
|
<td class="paramname"><em>is_arc</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> </td>
|
|
<td class="paramname"><em>num_nodes</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype"><a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html#ae49289c12a088e9f15bb26f927406c2f">CliqueCallback</a> </td>
|
|
<td class="paramname"><em>clique_callback</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Initializes the Bron-Kerbosch algorithm for the given graph and clique callback function. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00163">163</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a6dcb077f31531cc17c94da3364b6f099"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6dcb077f31531cc17c94da3364b6f099">◆ </a></span>Run()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename NodeIndex > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> <a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">operations_research::BronKerboschAlgorithm</a>< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> >::Run </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Runs the Bron-Kerbosch algorithm for kint64max iterations. </p>
|
|
<p>In practice, this is equivalent to running until completion or until the clique callback returns <a class="el" href="namespaceoperations__research.html#af2d89e69d073dc3036a6de24710b416fa615a46af313786fc4e349f34118be111" title="The algorithm will stop the search immediately.">BronKerboschAlgorithmStatus::STOP</a>. If the method returned because the search is finished, it will return COMPLETED; otherwise, it will return INTERRUPTED and it can be resumed by calling this method again. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00553">553</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a14b12a4c5ea291009f47c1a98c458f81"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a14b12a4c5ea291009f47c1a98c458f81">◆ </a></span>RunIterations()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename NodeIndex > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> <a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">operations_research::BronKerboschAlgorithm</a>< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> >::RunIterations </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int64 </td>
|
|
<td class="paramname"><em>max_num_iterations</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Runs at most 'max_num_iterations' iterations of the Bron-Kerbosch algorithm. </p>
|
|
<p>When this function returns INTERRUPTED, there is still work to be done to process all the cliques in the graph. In such case the method can be called again and it will resume the work where the previous call had stopped. When it returns COMPLETED any subsequent call to the method will resume the search from the beginning. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00546">546</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa28a934535a824fa63672b6c314b61cc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa28a934535a824fa63672b6c314b61cc">◆ </a></span>RunWithTimeLimit() <span class="overload">[1/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename NodeIndex > </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> <a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">operations_research::BronKerboschAlgorithm</a>< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> >::RunWithTimeLimit </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int64 </td>
|
|
<td class="paramname"><em>max_num_iterations</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">TimeLimit * </td>
|
|
<td class="paramname"><em>time_limit</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Runs at most 'max_num_iterations' iterations of the Bron-Kerbosch algorithm, until the time limit is exceeded or until all cliques are enumerated. </p>
|
|
<p>When this function returns INTERRUPTED, there is still work to be done to process all the cliques in the graph. In such case the method can be called again and it will resume the work where the previous call had stopped. When it returns COMPLETED any subsequent call to the method will resume the search from the beginning. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00508">508</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a4a1ea40849bc5e92cecec1a90f2f2bb9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a4a1ea40849bc5e92cecec1a90f2f2bb9">◆ </a></span>RunWithTimeLimit() <span class="overload">[2/2]</span></h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<typename NodeIndex > </div>
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="namespaceoperations__research.html#a708cf34b342e7d2ed89a3b73dbec4eae">BronKerboschAlgorithmStatus</a> <a class="el" href="classoperations__research_1_1BronKerboschAlgorithm.html">operations_research::BronKerboschAlgorithm</a>< <a class="el" href="namespaceoperations__research.html#a0e629e35bfa311b31dd7f5065eb834bb">NodeIndex</a> >::RunWithTimeLimit </td>
|
|
<td>(</td>
|
|
<td class="paramtype">TimeLimit * </td>
|
|
<td class="paramname"><em>time_limit</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Runs the Bron-Kerbosch algorithm for at most kint64max iterations, until the time limit is excceded or until all cliques are enumerated. </p>
|
|
<p>In practice, running the algorithm for kint64max iterations is equivalent to running until completion or until the other stopping conditions apply. When this function returns INTERRUPTED, there is still work to be done to process all the cliques in the graph. In such case the method can be called again and it will resume the work where the previous call had stopped. When it returns COMPLETED any subsequent call to the method will resume the search from the beginning. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="cliques_8h_source.html#l00203">203</a> of file <a class="el" href="cliques_8h_source.html">cliques.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="cliques_8h_source.html">cliques.h</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|