From 3c572e212d6e2903f29a2ca9f8d6c5f8e93b2d63 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Sun, 30 Jul 2023 13:44:59 +0200 Subject: [PATCH] tiny change in graph --- graph.cc | 9 +++++---- graph.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/graph.cc b/graph.cc index 419221e..60f41c4 100644 --- a/graph.cc +++ b/graph.cc @@ -112,12 +112,12 @@ return r; //found cliques releatedly until the whole graph is covered //could be recursive but we made it iterative template -NRVec cliquecover(const G &adjacency) +NRVec cliquecover(const G &adjacency, int *ncliques) { int n=adjacency.nrows(); NRVec r(n); r.clear(); G graph = adjacency; -int cliquenumber=1; +int cliquenumber=0; int remaining=n; NRVec cliques(0); NRVec notincliques(n); @@ -128,8 +128,8 @@ while(remaining) NRVec cliqueorignum(clique.size()); for(int i=0; i neighbors(const NRSMat &adjacency, const int v); \ template NRVec nonneighbors(const NRSMat &adjacency, const int v); \ template NRVec findclique(const NRSMat &adjacency, const int v); \ template NRVec complement(const NRSMat &adjacency, const NRVec & vertexlist); \ -template NRVec cliquecover(const NRSMat &adjacency); \ +template NRVec cliquecover(const NRSMat &adjacency, int *ncliques); \ diff --git a/graph.h b/graph.h index d8a583c..a0e3123 100644 --- a/graph.h +++ b/graph.h @@ -46,7 +46,7 @@ template NRVec complement(const G &adjacency, const NRVec & vertexlist); template -NRVec cliquecover(const G &adjacency); +NRVec cliquecover(const G &adjacency, int *ncliques=NULL);