Skip to content

Commit

Permalink
Fix issue in Pegasus K_4 embeddings (#159)
Browse files Browse the repository at this point in the history
fixed issue where one edge wasn't getting checked in pegasus K_4 embeddings
  • Loading branch information
boothby authored Sep 18, 2020
1 parent 3ba21ad commit 5cb901f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/busclique/small_cliques.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool find_generic_3(const vector<pair<size_t, size_t>> &edges,
B.emplace(e.first);
A.emplace(e.second);
}
return false;
return false;
}

//find a 4-clique in a generic graph
Expand All @@ -78,7 +78,7 @@ bool find_generic_4(const vector<pair<size_t, size_t>> &edges,
for(auto &p : A) {
if(B.count(p) == 0) continue;
for(auto &q : A) {
if(p < q || B.count(p) == 0) continue;
if(p < q || B.count(q) == 0) continue;
// here we've found the edges a~b, a~p, a~q, b~p, b~q
// so to finish the clique we only need to know p~q
auto z = adj.find(q);
Expand All @@ -95,7 +95,7 @@ bool find_generic_4(const vector<pair<size_t, size_t>> &edges,
B.emplace(e.first);
A.emplace(e.second);
}
return false;
return false;
}


Expand Down
2 changes: 1 addition & 1 deletion minorminer/package_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "0.2.1"
__version__ = "0.2.2"
__author__ = "Kelly Boothby"
__authoremail__ = "[email protected]"
__description__ = "heuristic algorithm to find graph minor embeddings"
6 changes: 6 additions & 0 deletions minorminer/tests/test_busclique.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,9 @@ def reconstructor(g):
test_python = test_nocache,
test_nocache = test_nocache)

def test_k4_bug(self):
edges = [30, 2940], [30, 2955], [45, 2940], [45, 2955], [2940, 2955]
p = dnx.pegasus_graph(16, edge_list = edges)
k4 = busclique.find_clique_embedding(4, p)

self.assertEquals(k4, {})

0 comments on commit 5cb901f

Please sign in to comment.