protected function init() { $this->size = rand(6, 8); $this->graphTemplate = GraphTemplate::getGraph(array("numVertex" => $this->size, "directed" => false, "connected" => true)); $this->adjList = generateAdjList($this->graphTemplate); //array of array of Pairs $this->edgeList = generateEdgeList($this->graphTemplate); //array of triples }
protected function getAnswerNonzero($qObj) { $graphTemplate = $qObj->internalDS; $edgeList = generateEdgeList($graphTemplate); $nEdges = count($edgeList); $ans = 2 * $nEdges; return $ans; }