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
Isolates2.h
#ifndef ISOLATES_H
#define ISOLATES_H
#include "Set.h"
#include "ArraySet.h"
#include "SparseArraySet.h"
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <ctime>
////#define TIMERS
////#define SPARSE
template <typename NeighborSet> class Isolates2
{
public:
Isolates2(std::vector<std::vector<int>> const &adjacencyArray);
~Isolates2();
void RemoveVertexAndNeighbors(int const vertex, std::vector<int> &vRemoved);
void RemoveVertex(int const vertex);
void RemoveAllIsolates(int const independentSetSIze, std::vector<int> &vIsolateVertices, std::vector<int> &vOtherRemovedVertices, std::vector<std::pair<int,int>> &vAddedEdges, bool const bConsiderAllVertices);
void ReplaceAllRemoved(std::vector<int> const &vRemoved);
int NextVertexToRemove(std::vector<int> &vVertices);
int NextVertexToRemove();
size_t size() const { return isolates.Size(); }
ArraySet const& GetIsolates() const { return isolates; }
ArraySet const& GetInGraph() const { return inGraph; }
#ifdef SPARSE
std::vector<SparseArraySet> const& Neighbors() const { return neighbors; }
#else
std::vector<NeighborSet> const& Neighbors() const { return neighbors; }
#endif //SPARSE
//// void RemoveEdges(std::vector<std::pair<int,int>> const &vEdges);
int GetAlternativeVertex(int const vertex) const;
void SetConnectedComponent(std::vector<int> const &vVertices);
protected: // methods
bool RemoveIsolatedClique (int const vertex, std::vector<int> &vIsolateVertices, std::vector<int> &vOtherRemovedVertices);
//// bool RemoveIsolatedPath (int const vertex, std::vector<int> &vIsolateVertices, std::vector<int> &vOtherRemovedVertices, std::vector<std::pair<int,int>> &vAddedEdges);
protected: // members
std::vector<std::vector<int>> const &m_AdjacencyArray;
#ifdef SPARSE
std::vector<SparseArraySet> neighbors;
#else
std::vector<NeighborSet> neighbors;
#endif // SPARSE
ArraySet inGraph;
ArraySet isolates;
ArraySet remaining;
std::vector<bool> vMarkedVertices;
std::map<int,int> m_AlternativeVertices;
#ifdef TIMERS
clock_t timer;
clock_t removeTimer;
clock_t replaceTimer;
clock_t sortDuringNextTimer;
clock_t removeOneDuringNextTimer;
clock_t removeDuringNextTimer;
clock_t replaceDuringNextTimer;
#endif // TIMERS
bool m_bConnectedComponentMode;
};
#endif //ISOLATES_H
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...