mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-13 15:49:45 +08:00
Documentation for 901f231d59
This commit is contained in:
229
dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html
Normal file
229
dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html
Normal file
@@ -0,0 +1,229 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: greedy_algorithms::stable_matching Namespace Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html','../../'); initResizable(true); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#func-members">Functions</a> </div>
|
||||
<div class="headertitle"><div class="title">greedy_algorithms::stable_matching Namespace Reference</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>Functions for the Gale-Shapley Algorithm.
|
||||
<a href="#details">More...</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a6d7e84df47dcf19e88f95f8f9040306c" id="r_a6d7e84df47dcf19e88f95f8f9040306c"><td class="memItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="#a6d7e84df47dcf19e88f95f8f9040306c">gale_shapley</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> > > &secondary_preferences, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> > > &primary_preferences)</td></tr>
|
||||
<tr class="memdesc:a6d7e84df47dcf19e88f95f8f9040306c"><td class="mdescLeft"> </td><td class="mdescRight">The main function that finds the stable matching between two sets of elements using the Gale-Shapley Algorithm. <br /></td></tr>
|
||||
<tr class="separator:a6d7e84df47dcf19e88f95f8f9040306c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Functions for the Gale-Shapley Algorithm. </p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a6d7e84df47dcf19e88f95f8f9040306c" name="a6d7e84df47dcf19e88f95f8f9040306c"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a6d7e84df47dcf19e88f95f8f9040306c">◆ </a></span>gale_shapley()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> > greedy_algorithms::stable_matching::gale_shapley </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> > > &</td> <td class="paramname"><span class="paramname"><em>secondary_preferences</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> > > &</td> <td class="paramname"><span class="paramname"><em>primary_preferences</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The main function that finds the stable matching between two sets of elements using the Gale-Shapley Algorithm. </p>
|
||||
<dl class="section note"><dt>Note</dt><dd>This doesn't work on negative preferences. the preferences should be continuous integers starting from 0 to number of preferences - 1. </dd></dl>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">primary_preferences</td><td>the preferences of the primary set should be a 2D vector </td></tr>
|
||||
<tr><td class="paramname">secondary_preferences</td><td>the preferences of the secondary set should be a 2D vector </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>matches the stable matching between the two sets </dd></dl>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 42</span> {</div>
|
||||
<div class="line"><span class="lineno"> 43</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> num_elements = secondary_preferences.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>();</div>
|
||||
<div class="line"><span class="lineno"> 44</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::uint32_t></a> matches(num_elements, -1);</div>
|
||||
<div class="line"><span class="lineno"> 45</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<bool></a> is_free_primary(num_elements, <span class="keyword">true</span>);</div>
|
||||
<div class="line"><span class="lineno"> 46</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<std::uint32_t></a> proposal_index(num_elements, 0); <span class="comment">// Tracks the next secondary to propose for each primary</span></div>
|
||||
<div class="line"><span class="lineno"> 47</span> </div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
|
||||
<div class="line"><span class="lineno"> 49</span> <span class="keywordtype">int</span> free_primary_index = -1;</div>
|
||||
<div class="line"><span class="lineno"> 50</span> </div>
|
||||
<div class="line"><span class="lineno"> 51</span> <span class="comment">// Find the next free primary</span></div>
|
||||
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">for</span> (<a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> i = 0; i < num_elements; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 53</span> <span class="keywordflow">if</span> (is_free_primary[i]) {</div>
|
||||
<div class="line"><span class="lineno"> 54</span> free_primary_index = i;</div>
|
||||
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 56</span> }</div>
|
||||
<div class="line"><span class="lineno"> 57</span> }</div>
|
||||
<div class="line"><span class="lineno"> 58</span> </div>
|
||||
<div class="line"><span class="lineno"> 59</span> <span class="comment">// If no free primary is found, break the loop</span></div>
|
||||
<div class="line"><span class="lineno"> 60</span> <span class="keywordflow">if</span> (free_primary_index == -1) <span class="keywordflow">break</span>;</div>
|
||||
<div class="line"><span class="lineno"> 61</span> </div>
|
||||
<div class="line"><span class="lineno"> 62</span> <span class="comment">// Get the next secondary to propose</span></div>
|
||||
<div class="line"><span class="lineno"> 63</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> secondary_to_propose = primary_preferences[free_primary_index][proposal_index[free_primary_index]];</div>
|
||||
<div class="line"><span class="lineno"> 64</span> proposal_index[free_primary_index]++;</div>
|
||||
<div class="line"><span class="lineno"> 65</span> </div>
|
||||
<div class="line"><span class="lineno"> 66</span> <span class="comment">// Get the current match of the secondary</span></div>
|
||||
<div class="line"><span class="lineno"> 67</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a> current_match = matches[secondary_to_propose];</div>
|
||||
<div class="line"><span class="lineno"> 68</span> </div>
|
||||
<div class="line"><span class="lineno"> 69</span> <span class="comment">// If the secondary is free, match them</span></div>
|
||||
<div class="line"><span class="lineno"> 70</span> <span class="keywordflow">if</span> (current_match == -1) {</div>
|
||||
<div class="line"><span class="lineno"> 71</span> matches[secondary_to_propose] = free_primary_index;</div>
|
||||
<div class="line"><span class="lineno"> 72</span> is_free_primary[free_primary_index] = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 73</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 74</span> <span class="comment">// Determine if the current match should be replaced</span></div>
|
||||
<div class="line"><span class="lineno"> 75</span> <span class="keyword">auto</span> new_proposer_rank = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/find.html">std::find</a>(secondary_preferences[secondary_to_propose].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">begin</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 76</span> secondary_preferences[secondary_to_propose].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">end</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 77</span> free_primary_index);</div>
|
||||
<div class="line"><span class="lineno"> 78</span> <span class="keyword">auto</span> current_match_rank = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/find.html">std::find</a>(secondary_preferences[secondary_to_propose].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/begin.html">begin</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 79</span> secondary_preferences[secondary_to_propose].<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/iterator/end.html">end</a>(),</div>
|
||||
<div class="line"><span class="lineno"> 80</span> current_match);</div>
|
||||
<div class="line"><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><span class="lineno"> 82</span> <span class="comment">// If the new proposer is preferred over the current match</span></div>
|
||||
<div class="line"><span class="lineno"> 83</span> <span class="keywordflow">if</span> (new_proposer_rank < current_match_rank) {</div>
|
||||
<div class="line"><span class="lineno"> 84</span> matches[secondary_to_propose] = free_primary_index;</div>
|
||||
<div class="line"><span class="lineno"> 85</span> is_free_primary[free_primary_index] = <span class="keyword">false</span>;</div>
|
||||
<div class="line"><span class="lineno"> 86</span> is_free_primary[current_match] = <span class="keyword">true</span>; <span class="comment">// Current match is now free</span></div>
|
||||
<div class="line"><span class="lineno"> 87</span> }</div>
|
||||
<div class="line"><span class="lineno"> 88</span> }</div>
|
||||
<div class="line"><span class="lineno"> 89</span> }</div>
|
||||
<div class="line"><span class="lineno"> 90</span> </div>
|
||||
<div class="line"><span class="lineno"> 91</span> <span class="keywordflow">return</span> matches;</div>
|
||||
<div class="line"><span class="lineno"> 92</span>}</div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/begin.html">std::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/iterator/end.html">std::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="afind_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/find.html">std::find</a></div><div class="ttdeci">T find(T... args)</div></div>
|
||||
<div class="ttc" id="ainteger_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/integer.html">std::uint32_t</a></div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../dd/d9a/namespacegreedy__algorithms_1_1stable__matching_a6d7e84df47dcf19e88f95f8f9040306c_cgraph.svg" width="276" height="67"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../d2/d90/namespacegreedy__algorithms.html">greedy_algorithms</a></li><li class="navelem"><a class="el" href="../../dd/d9a/namespacegreedy__algorithms_1_1stable__matching.html">stable_matching</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
<map id="greedy_algorithms::stable_matching::gale_shapley" name="greedy_algorithms::stable_matching::gale_shapley">
|
||||
<area shape="rect" id="Node000001" title="The main function that finds the stable matching between two sets of elements using the Gale-Shapley ..." alt="" coords="5,5,154,61"/>
|
||||
<area shape="rect" id="Node000002" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/algorithm/find.html#" title=" " alt="" coords="202,20,270,46"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="154,30,186,30,186,36,154,36"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
d3562925c9ac7b7d6fd2b415f97bed7a
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.1 (20240910.0053)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms::stable_matching::gale_shapley Pages: 1 -->
|
||||
<svg width="207pt" height="50pt"
|
||||
viewBox="0.00 0.00 206.50 49.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 45.75)">
|
||||
<title>greedy_algorithms::stable_matching::gale_shapley</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="The main function that finds the stable matching between two sets of elements using the Gale-Shapley ...">
|
||||
<polygon fill="#999999" stroke="#666666" points="111.25,-41.75 0,-41.75 0,0 111.25,0 111.25,-41.75"/>
|
||||
<text text-anchor="start" x="8" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
|
||||
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">stable_matching::gale</text>
|
||||
<text text-anchor="middle" x="55.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_shapley</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/find.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="198.5,-30.5 147.25,-30.5 147.25,-11.25 198.5,-11.25 198.5,-30.5"/>
|
||||
<text text-anchor="middle" x="172.88" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">std::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M111.55,-20.88C119.69,-20.88 127.91,-20.88 135.54,-20.88"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="135.45,-24.38 145.45,-20.88 135.45,-17.38 135.45,-24.38"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.1 (20240910.0053)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms::stable_matching::gale_shapley Pages: 1 -->
|
||||
<svg width="207pt" height="50pt"
|
||||
viewBox="0.00 0.00 206.50 49.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 45.75)">
|
||||
<title>greedy_algorithms::stable_matching::gale_shapley</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="The main function that finds the stable matching between two sets of elements using the Gale-Shapley ...">
|
||||
<polygon fill="#999999" stroke="#666666" points="111.25,-41.75 0,-41.75 0,0 111.25,0 111.25,-41.75"/>
|
||||
<text text-anchor="start" x="8" y="-28.25" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms::</text>
|
||||
<text text-anchor="start" x="8" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">stable_matching::gale</text>
|
||||
<text text-anchor="middle" x="55.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">_shapley</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/algorithm/find.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="198.5,-30.5 147.25,-30.5 147.25,-11.25 198.5,-11.25 198.5,-30.5"/>
|
||||
<text text-anchor="middle" x="172.88" y="-17" font-family="Helvetica,sans-Serif" font-size="10.00">std::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M111.55,-20.88C119.69,-20.88 127.91,-20.88 135.54,-20.88"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="135.45,-24.38 145.45,-20.88 135.45,-17.38 135.45,-24.38"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
11
dd/dab/gale__shapley_8cpp__incl.map
Normal file
11
dd/dab/gale__shapley_8cpp__incl.map
Normal file
@@ -0,0 +1,11 @@
|
||||
<map id="greedy_algorithms/gale_shapley.cpp" name="greedy_algorithms/gale_shapley.cpp">
|
||||
<area shape="rect" id="Node000001" title="Gale Shapley Algorithm" alt="" coords="95,5,251,46"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,94,77,120"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="141,49,76,88,73,83,139,44"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="100,94,158,120"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="164,48,145,82,141,79,160,45"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="181,94,256,120"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="187,45,206,79,201,82,182,48"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="280,94,344,120"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="209,44,279,84,276,88,206,49"/>
|
||||
</map>
|
||||
1
dd/dab/gale__shapley_8cpp__incl.md5
Normal file
1
dd/dab/gale__shapley_8cpp__incl.md5
Normal file
@@ -0,0 +1 @@
|
||||
4b4ec511a50c6aac961709ae72aea6f2
|
||||
120
dd/dab/gale__shapley_8cpp__incl.svg
Normal file
120
dd/dab/gale__shapley_8cpp__incl.svg
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.1 (20240910.0053)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms/gale_shapley.cpp Pages: 1 -->
|
||||
<svg width="262pt" height="94pt"
|
||||
viewBox="0.00 0.00 261.88 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 89.75)">
|
||||
<title>greedy_algorithms/gale_shapley.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Gale Shapley Algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="184,-85.75 67.5,-85.75 67.5,-55.25 184,-55.25 184,-85.75"/>
|
||||
<text text-anchor="start" x="75.5" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms/gale</text>
|
||||
<text text-anchor="middle" x="125.75" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_shapley.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="53.5,-19.25 0,-19.25 0,0 53.5,0 53.5,-19.25"/>
|
||||
<text text-anchor="middle" x="26.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M101.02,-54.8C85.95,-45.83 66.74,-34.41 51.63,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="53.62,-22.53 43.23,-20.43 50.04,-28.55 53.62,-22.53"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="114.25,-19.25 71.25,-19.25 71.25,0 114.25,0 114.25,-19.25"/>
|
||||
<text text-anchor="middle" x="92.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M117.59,-54.95C113.29,-47.28 107.97,-37.77 103.35,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="106.52,-28.03 98.58,-21.02 100.41,-31.46 106.52,-28.03"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="187.62,-19.25 131.88,-19.25 131.88,0 187.62,0 187.62,-19.25"/>
|
||||
<text text-anchor="middle" x="159.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">algorithm</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M134.15,-54.95C138.58,-47.28 144.07,-37.77 148.83,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="151.78,-31.42 153.75,-21.01 145.72,-27.92 151.78,-31.42"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="253.88,-19.25 205.62,-19.25 205.62,0 253.88,0 253.88,-19.25"/>
|
||||
<text text-anchor="middle" x="229.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M151.73,-54.8C167.72,-45.74 188.13,-34.19 204.07,-25.16"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="205.51,-28.37 212.48,-20.4 202.06,-22.28 205.51,-28.37"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
94
dd/dab/gale__shapley_8cpp__incl_org.svg
Normal file
94
dd/dab/gale__shapley_8cpp__incl_org.svg
Normal file
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.1 (20240910.0053)
|
||||
-->
|
||||
<!-- Title: greedy_algorithms/gale_shapley.cpp Pages: 1 -->
|
||||
<svg width="262pt" height="94pt"
|
||||
viewBox="0.00 0.00 261.88 93.75" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 89.75)">
|
||||
<title>greedy_algorithms/gale_shapley.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Gale Shapley Algorithm">
|
||||
<polygon fill="#999999" stroke="#666666" points="184,-85.75 67.5,-85.75 67.5,-55.25 184,-55.25 184,-85.75"/>
|
||||
<text text-anchor="start" x="75.5" y="-72.25" font-family="Helvetica,sans-Serif" font-size="10.00">greedy_algorithms/gale</text>
|
||||
<text text-anchor="middle" x="125.75" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">_shapley.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="53.5,-19.25 0,-19.25 0,0 53.5,0 53.5,-19.25"/>
|
||||
<text text-anchor="middle" x="26.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M101.02,-54.8C85.95,-45.83 66.74,-34.41 51.63,-25.42"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="53.62,-22.53 43.23,-20.43 50.04,-28.55 53.62,-22.53"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="114.25,-19.25 71.25,-19.25 71.25,0 114.25,0 114.25,-19.25"/>
|
||||
<text text-anchor="middle" x="92.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node3 -->
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M117.59,-54.95C113.29,-47.28 107.97,-37.77 103.35,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="106.52,-28.03 98.58,-21.02 100.41,-31.46 106.52,-28.03"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="187.62,-19.25 131.88,-19.25 131.88,0 187.62,0 187.62,-19.25"/>
|
||||
<text text-anchor="middle" x="159.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">algorithm</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node4 -->
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M134.15,-54.95C138.58,-47.28 144.07,-37.77 148.83,-29.54"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="151.78,-31.42 153.75,-21.01 145.72,-27.92 151.78,-31.42"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="253.88,-19.25 205.62,-19.25 205.62,0 253.88,0 253.88,-19.25"/>
|
||||
<text text-anchor="middle" x="229.75" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node5 -->
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M151.73,-54.8C167.72,-45.74 188.13,-34.19 204.07,-25.16"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="205.51,-28.37 212.48,-20.4 202.06,-22.28 205.51,-28.37"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
Reference in New Issue
Block a user