Well,this post is related to my last one(that program to calculate the maximum flow along a directed graph: Post - "segmentation fault")
I have been quite occupied in the last few days so only looked again to my program today.After analysing it carefully,i realized that the effience problem was due to the somador function.It has to see the peso of an element of the list,but the element could be far away in the list,which takes a lot of time if we consider the big files.So,this is what i´m trying to do now:
1.compute the first flow
2.then start moving backwards
3.in the next sum only add the new nodes
For example,if i have the path 1234567 and i have a new transition only from 5 to 7,the path becomes 123457 but i dont need to calculate the 12345 path again,because it has been calculated before.So,when i move backwards one node,the flow is subbed the peso from the last transition. The problem is getting to somador and knowing the number of new nodes.I'm using a variable but dont know exactly where it sould be dec and incremented...Can anyone help me with this?2 more days left for the delivery of the project...