def __init__(self, size, noOfEdges): """ Constructs an empty graph @param size Number of vertices to be considered for generation @param noOfEdges Number of edges to generate """ NumberedEdgeUndirectedGraph.__init__(self) ## Number of vertices to be considered for generation self.graphSize = size ## Number of edges to generate self.noOfEdges = noOfEdges ## Parameters of the RMAT algorithm. Decide the probability with which quadrants in an adjacency matrix are chosen ## \todo Add description about choosing these probabilities ## Probability of choosing quadrant A self.probA = 0.45 ## Probability of choosing quadrant B self.probB = 0.15 ## Probability of choosing quadrant C self.probC = 0.15 ## Probability of choosing quadrant D self.probD = 0.25 ## Temporary storage of edges. Maintained for achieving performance self.serialEdgeList = [] ## Debug flag self.debug = 0 self.startVertX = 1 self.endVertX = size self.startVertY = 1 self.endVertY = size ## Logger instance self.logger = PyGelLogging().getLogger()
def __init__(self): """ Constructs a numbered edge graph """ ## Dictionary of edges, indexed by edge number self.edgeIndex = {} ## Dictionary of vertices, indexed by vertex number self.vertexIndex = {} ## Dictionary of vertices, indexed by parent self.parentIndex = {} ## Dictionary of vertices and edge numbers, indexed by parent self.parentEdgeIndex = {} ## Last edge number assigned self.__lastEdgeNumber = -1 ## Dictionary of degree counts. Used for efficiently computing degree distribution self.__degreeCount = {} ## Logger instance self.logger = PyGelLogging().getLogger()