https://gitlab.informatik.uni-bremen.de/grapa/java/maxcliqueenumeration
Revision 11b30123c80c717f2ed14158faeed9ecb3cdc815 authored by Darren Strash on 01 March 2016, 14:08:53 UTC, committed by Darren Strash on 01 March 2016, 14:08:53 UTC
1 parent 6057776
Tip revision: 11b30123c80c717f2ed14158faeed9ecb3cdc815 authored by Darren Strash on 01 March 2016, 14:08:53 UTC
Start development on faster bipartite matching
Start development on faster bipartite matching
Tip revision: 11b3012
IndependentSets.cpp
#include "IndependentSets.h"
#include <vector>
#include <iostream>
#include <cstring> // memcpy
using namespace std;
IndependentSets::IndependentSets(vector<vector<int>> &adjacencyList)
: VertexSets("adjlist")
, beginX(0)
, beginP(0)
, beginR(adjacencyList.size())
, m_AdjacencyList(adjacencyList)
, vertexSets()
, vertexLookup()
, degree()
, m_lDelineators()
{
}
IndependentSets::~IndependentSets()
{
}
void IndependentSets::Initialize()
{
m_lDelineators.reserve(10);
vertexSets .resize(m_AdjacencyList.size(), 0);
vertexLookup.resize(m_AdjacencyList.size(), 0);
degree .resize(m_AdjacencyList.size(), 0);
for (size_t i = 0; i < m_AdjacencyList.size(); ++i) {
degree[i] = m_AdjacencyList[i].size();
}
// indices indicating where each set P, X, R starts in
// vertexSets; initially, P contains all the vertices
for (size_t i = 0; i < m_AdjacencyList.size(); ++i) {
vertexSets[i] = i;
vertexLookup[i] = i;
}
}
void IndependentSets::PrintSummary(int const line) const
{
cout << line << ": X[" << beginX << ":" << beginP << "), P[" << beginP << ":" << beginR << ")" << endl;
}
bool IndependentSets::GetNextTopLevelPartition()
{
beginX = 0;
beginP = 0;
beginR = m_AdjacencyList.size();
bool const returnValue(!m_bDoneWithTopLevelPartitions);
m_bDoneWithTopLevelPartitions = true;
return returnValue;
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...