graph.cpp
//return distance from node to node
return distance from node to node
return distance from node to node
int Node::weight_to_node(Node* n)
{
	int weight = 0;
	if(this->URx <= n->LLx )
	{
		weight += n->LLx - this->URx;
	}
	else if(n->URx <= this->LLx)
	{
		weight += this->LLx - n->URx;
	}
	if(this->URy <= n->LLy)
	{
		weight += n->LLy - this->URy;
	}
	else if(n->URy <= this->LLy)
	{
		weight += this->LLy - n->URy;
	}
	weight += abs(this->Layer - n->Layer);
	return weight;
}
int Node :: weight_to_node ( Node * n ) { int weight = 0 ; if ( this -> URx <= n -> LLx ) { weight += n -> LLx - this -> URx ; } else if ( n -> URx <= this -> LLx ) { weight += this -> LLx - n -> URx ; } if ( this -> URy <= n -> LLy ) { weight += n -> LLy - this -> URy ; } else if ( n -> URy <= this -> LLy ) { weight += this -> LLy - n -> URy ; } weight += abs ( this -> Layer - n -> Layer ) ; return weight ; }
return distance from node to node
return distance from node to node
//weight += (this->viaCost * abs(this->Layer - n->Layer));