decontamination

graph decontamination problem
git clone https://a3nm.net/git/decontamination/
Log | Files | Refs

commit ebd65fa5a91961a1c22c73284ca257b9018992c3
parent 2ddc413376990ab4b2fc8ca95d266906d6cf644d
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri, 13 Dec 2024 17:39:41 +0100

undirected graphs

Diffstat:
decontamination.cpp | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/decontamination.cpp b/decontamination.cpp @@ -20,6 +20,9 @@ // if set, only display the graph, not the strategy #define DISPLAYGRAPH 0 +// if set, symmetrize graph +#define UNDIRECTED 1 + // maximal number of nodes to shoot simultaneously #define MAXK 1 @@ -56,6 +59,10 @@ int main() { n = max(n, max(f, t)); G[f][nG[f]] = t; nG[f]++; + if (UNDIRECTED) { + G[t][nG[t]] = f; + nG[t]++; + } } n++; // so that vertices are from 0 to n-1