473,396 Members | 1,765 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Pathfinding

15
Hi,
Can anyone tell me how to find the shortest path in a graph when the weights of the graph are dynamic? That is if u go from A to B, the weight of B to C will change in some deterministic way. Can anyone at least point me to some resources? Because I have raised the same question before and I did not get a satisfactory answer from anyone. Thank you.
Apr 9 '07 #1
3 2224
RedSon
5,000 Expert 4TB
Hi,
Can anyone tell me how to find the shortest path in a graph when the weights of the graph are dynamic? That is if u go from A to B, the weight of B to C will change in some deterministic way. Can anyone at least point me to some resources? Because I have raised the same question before and I did not get a satisfactory answer from anyone. Thank you.
Hmm graph theory is a tough subject. What are you trying to accomplish? Finding a good algorithm is going to be difficult. Some common ways to approach shortest path is to use greedy algorithms, or Dijkstra. You can check out Wikipedia for Shortest Path Problems or this site for Dijkstra's.
Apr 9 '07 #2
imcram
15
I am able to use Dijkstra's or other conventional pathfinders. This is the problem with them:

Usually the weights of the edges of the graph are static. They are not affected by the path taken. But, what if the weights themselves are affected by the path taken so far? Ex:

Think of school transport. There is a bus that transports students to the school. Let us say that the fuel cost per unit distance is proportional to the students onboard. There are children in different places, and all of them have to get to the school. Suppose we want to find out the path which would collect all the children and deleiver them to the school while minimizing the fuel cost. How do we do this? I can't think of an algorithm for such a problem. If anyone can help, I'd be most glad.
Apr 10 '07 #3
RedSon
5,000 Expert 4TB
It is the same problem you just have to do pathfinding at each node. Every time you get to a node you again have to see which is the shortest path. I assume that once you choose a path the weight of the path from the node you are in to the next node will not change. If it changes while you are on the path then there is no way to find the shortest path from one node to another.
Apr 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Martin Berg | last post by:
Hi, I am providing a community. Each member is able to add his own contacts at the community. For example: A knows B A knows F B knows C
0
by: Martin Berg | last post by:
Hi, thanks a lot. All of your replies are helping me a lot. bye Mad
8
by: slickn_sly | last post by:
Why am i getting an error? public void breadthFirst( TreeNode tNode) { Queue q = new Queue( ); if( q.isEmpty() ) { q.enqueue( this ); }
2
by: Nevyn | last post by:
Hi, having a class like the following class node { int nodeID; list<node> listOfChildren; list<node> listOfParents; } what is the smartest/fastest way to find the nearest common parent...
2
by: ThePsudo | last post by:
# SIMPLE VERSION # Is there a way I can create a new <img> tag onClick? # DETAILED VERSON # I'm making a game that involves drawing a path between two points on a grid. I've got the...
8
by: Chua Wen Ching | last post by:
Hi there. I was wondering is there any C# A* Pathfinding source code! I try to find and the best place is planetsourcecode vb.net A* Pathfinding... but vb.net syntax is too different if...
4
by: Crirus | last post by:
Hello! If anyone has implemented A*, I whould like to hear some advices how to make it as fast as possible.... I use ArrayList to store nodes, there is a faster class for store nodes Point and...
20
by: Crirus | last post by:
I have this situation 25 26 ........ 9 10 11 12 13 24 1 2 3 15 23 8 x 4 15 22 7 6 5 16 21 20 19 18 17
3
by: jesper | last post by:
I would like some feedback on this. A while back I was trying my hand at some pathfinding for a small game I was making. I did not know anything about it so I read some stuff and came up with the...
2
by: Andreas Røsdal | last post by:
Hi, I'm using the Python profiler to optimize a pathfinding algorithm of a game, and would like some help from someone who knows how to improve the performance of Python code. The algorithm is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.