Hello All!
I have been working on a network design problem and am having a problem in the following part-
What I am trying to do here --
{
for every set of edges (a,b),
{ for all arcs (l,m)
assign length of -- arc [l,m] = edge [a,b][l,m]
shortest_path (num_nodes, arr_nodes, source);
}
----------------------------------------------------------------------------
Part of the Code which does the above looks like this -
for ( node = arr_nodes; node < arr_nodes + num_nodes; node++ )
{
edge_tail = (node - arr_nodes) + min_node;
for ( arc_pointer = node -> first; arc_pointer != (node+1) -> first; arc_pointer++ )
{
edge_head = ((arc_pointer -> head_edge) - arr_nodes) + min_node;
for ( node1 = arr_nodes; node1 < arr_nodes + num_nodes; node1++ )
{
tail_arc = tail1[count1];
for ( arc_pointer1 = node1 -> first; arc_pointer1 != (node1+1) -> first; arc_pointer1++ )
{
head_arc = ((arc_pointer->head_edge)-ndp)+nmin;
printf ( " Tail_Edge = %2ld Head_Edge = %2ld Tail_Arc = %2ld Head_Arc = %2ld Length = %4lf\n", edge_tail, head_in, tail_arc, head_arc, ta->len );
arc_pointer1 -> length = weight2[edge_tail][edge_head][tail_arc][head_arc];
shortest_path (num_nodes, arr_nodes, source);
}
count1++;
}
}
}
As of now it gives segmentation fault while displaying output at the print statement.
Kindly guide me in knowing what is wrong in my coding so that it could give the desired result.
Thanks!