private void computeNegativeWeightedShortestPath(Vertex origin)
	{	
		// queue for storing vertices not yet visited
		LinkedQueue q = new LinkedQueue();
	
		// Vertex in current shortest path
		Vertex v;
		
		// Vertex adjacent to v
		Vertex w;
		
		// Edge connecting v to w
		Edge e;
		
		// cost of Edge from v to w
		double vwCost;
		
		// reset shortest path info for vertices
		resetVertices();
		
		// start with origin Vertex
		q.enqueue(origin);
		
		// distance from origin to itself is 0
		origin.distance = 0.0;
		
		// indicate origin is in queue
		origin.scratch++;
		
		// find the shortest path
		while (!q.isEmpty())
		{
			// retrieve next Vertex to visit
			v = (Vertex)q.dequeue();
			
			if (v.scratch > 2 * theItems.size())
			{
				// negative cycle exists
				throw new GraphException("Negative cycle detected");
			}
			
			// indicate v has been dequeued
			v.scratch++;
			
			// search v's adjacent vertices
			for (Iterator itr = v.getAdjacentVertices().iterator(); itr.hasNext();)
			{
				// retrieve current Edge
				e = (Edge)itr.getCurrent();
				
				// retrieve destination Vertex from Edge
				w = e.destination;
				
				// retrieve edge cost
				vwCost = e.cost;
				
				if (w.distance > v.distance + vwCost)
				{
					// new shortest path from v to w found
					
					// update distance to w
					w.distance = v.distance + vwCost;
					
					// update link to previous Vertex in shortest path
					w.previousVertex = v;
					
					// enqueue w only if not already in queue
					if (w.scratch % 2 == 0)
					{
						// indicate w has been enqueued
						w.scratch++;
						
						// place w back in queue
						q.enqueue(w);
					}
				}
				
				// advance to next adjacent Vertex
				itr.next();
			}
		}
	}