473,399 Members | 3,832 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,399 software developers and data experts.

Please help. Weighted Directed Graph?

1
There are many nodes in the map, each of which is connected to other nodes. One way traffic for all edges, for instance, from N1 to either N2 or N3, but from N2 or N3 can’t directly go back to N1. One node can go to maximum two other nodes, and mamimum two nodes can go to the same node. The distance between any connection nodes, for instance, S1 (btw N1&N2), S2 (btw N1&N3), etc... is also important. Each node has its weight. Cost=distance*weight. For instance, from N1 to N2, the travelling cost=S1* weight of N2. There is no node that only has in or out path. (there is no starting or ending nodes). The problem is to find the least cost from any node to another node.

I think I can pair the distance with node ID (say, (S1, N2), (S5, N6), etc...) anyone can provide VC++ code for this?

Is this a weighted Directed Graph?
Mar 6 '08 #1
1 2773
Ganon11
3,652 Expert 2GB
The way this sounds, it could be either Weighted Undirected or Weighted Directed. Either way, check out Dijkstra's algorithm for the Shortest Path.
Mar 6 '08 #2

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

Similar topics

1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
1
by: questions? | last post by:
I heard from my friend who used to program in JAVA, it is really easy to do graph display in JAVA. I wonder whether there are similiar packages in Python I can use. Since I know a little bit...
7
by: find.dhiraj | last post by:
Hi, I need little bit of help regarding the question below , any of your additional insight beside mine to the problem will be a great help for me Consider the following, rather limited,...
1
by: pmarisole | last post by:
I need help in calculating a score from a row of drop-down values. I need to use the onChange to tally the score as the user moves across 9 categories (with drop-down selection of 1-9 or N/A)...
6
by: alessandro.carrega | last post by:
In Igraph library (http://cneurocvs.rmki.kfki.hu/igraph/) there's a method to add a weighted edge?
4
by: bukzor | last post by:
Can someone point me in the direction of a good solution of this? I'm using it to construct a SQL query compiler, where each node is a table and each edge is a join. I'm planning on using the...
7
thatos
by: thatos | last post by:
Here is the EdgeList class class Graph { protected int numvertices; protected int numedges; protected boolean directed; protected EdgeList adjlist ; // Constructors
3
by: mistusen | last post by:
the nodes of the graph has got x and y coordinate.we'll have to draw a directed graph with the nodes in java.where can i find the source code or what is used to draw the graph?plz suggest.how can i...
6
by: Carl Banks | last post by:
I was wondering if anyone had any advice on this. This is not to study graph theory; I'm using the graph to represent a problem domain. The graphs could be arbitrarily large, and could easily...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.