miércoles, 22 de abril de 2009

I propose new algorithm problem about rated digraphs

The goal: We should get the minimun value way betwen two nodes, with follows constrains:

  1. * The total path value is the sum of the edges in the A->B direction plus double value of B->A direction (if exists) .
  2. The graph it´s representated by a adjacency matrix .

A graph example :



One possible solution is: 1->2->3->4 with total path value* 10 (1->2 [4] 2->3 [5] 3->4 [10])

Download pascal code
(You need stack estructure [easy to computer engineer ;)])