From ff4ec3c5f56939a75ab6cf00ae519ed80abaacee Mon Sep 17 00:00:00 2001 From: Mathieu Dutour Sikiric Date: Mon, 25 Dec 2023 13:31:05 +0100 Subject: [PATCH] Add function IsSymmetricGraph to the GraphicalFunctions.h --- src_graph/GRAPH_GraphicalFunctions.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src_graph/GRAPH_GraphicalFunctions.h b/src_graph/GRAPH_GraphicalFunctions.h index eff94a2..ce94242 100644 --- a/src_graph/GRAPH_GraphicalFunctions.h +++ b/src_graph/GRAPH_GraphicalFunctions.h @@ -291,6 +291,25 @@ template bool IsSimpleGraph(Tgr const &GR) { return true; } +template bool IsSymmetricGraph(Tgr const &GR) { + size_t nbVert = GR.GetNbVert(); + MyMatrix M=ZeroMatrix(nbVert,nbVert); + for (size_t iVert = 0; iVert < nbVert; iVert++) { + std::vector LAdj = GR.Adjacency(iVert); + for (auto & eAdj : LAdj) { + M(iVert, eAdj) = 1; + } + } + for (size_t iVert=0; iVert std::vector> GetEdgeSet(Tgr const &GR) { size_t nbVert = GR.GetNbVert();