Esempio n. 1
0
EdgeNode<T>* Graph<T>::removeMin()
{
	EdgeNode<T>* minEdge = NULL;
	if(flag == FIBO_HEAP)
		minEdge = fHeap.removeMin()->getData();
	else
		minEdge = findMinEdge(edgeList);
	return minEdge;
}
Esempio n. 2
0
File: node.cpp Progetto: sawrubh/ghs
void Node::wakeup() {
  int minEdge = findMinEdge();
  // Branch state
  this->edges[minEdge].state = 1;
  pthread_mutex_lock(&(mst_mutex));
  mst.insert(pair<int,int>(this->edges[minEdge].weight,1));
  pthread_mutex_unlock(&(mst_mutex));
  this->level = 0;
  // Found State
  this->state = 2;
  this->findCount = 0;
  message msg;
  msg.id = 0;
  msg.args[0] = 0;
  msg.weight = this->edges[minEdge].weight;
  this->edges[minEdge].node->addMessage(msg);
}