From 9f3089c232d941b897a8393a5671c0bb557ff5b1 Mon Sep 17 00:00:00 2001 From: Csaba Kiraly Date: Wed, 29 Mar 2023 15:54:44 +0200 Subject: [PATCH] rowIDs and columnIDs are sets Fixes issue 29, where multiple instances of an ID in rowIDs created a topology with nodes with a huge degree. This huge degree then created lots of duplicates, eating up available bandwidth. Signed-off-by: Csaba Kiraly --- DAS/validator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DAS/validator.py b/DAS/validator.py index 49165a0..32ef149 100644 --- a/DAS/validator.py +++ b/DAS/validator.py @@ -69,8 +69,8 @@ class Validator: # random.seed(self.ID) self.nodeClass = 1 if (self.ID <= shape.numberNodes * shape.class1ratio) else 2 self.vpn = self.shape.vpn1 if (self.nodeClass == 1) else self.shape.vpn2 - self.rowIDs = rows if rows else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn) - self.columnIDs = columns if columns else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn) + self.rowIDs = set(rows) if rows else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn) + self.columnIDs = set(columns) if columns else unionOfSamples(range(self.shape.blockSize), self.shape.chi, self.vpn) self.rowNeighbors = collections.defaultdict(dict) self.columnNeighbors = collections.defaultdict(dict)