I wasn't sure if this was the best place to post since there isn't
really an algorithm section for programming. I was curious that if
you're given a MST tree of G and P is the shortest path between two
nodes s and t. If we increaset the cost of each edge of G by some
amount x, would P still be the shortest path between s and t, because
all the values are incremented by x amount or would it change? 2 2687
tonokio wrote: I wasn't sure if this was the best place to post since there isn't really an algorithm section for programming.
It's not. The newsgroup comp.programmin g is a likely candidate,
possibly sci.math.
If you have trouble converting your algorithm to code, then this is
right place, probably.
Brian
tonokio wrote: I wasn't sure if this was the best place to post since there isn't really an algorithm section for programming. I was curious that if you're given a MST tree of G and P is the shortest path between two nodes s and t. If we increaset the cost of each edge of G by some amount x, would P still be the shortest path between s and t, because all the values are incremented by x amount or would it change?
Off topic for comp.lang.c++. Setting follow-ups to comp.theory.
To answer your question, the shortest path can change. When you
increment all edges by x, the cost of any particular path increases by
m*x, where m is the number of edges.
So, just for example, let's say you have an s-t path p_1 with 3 edges,
each of cost 1, and another s-t path p_2 with 1 edge of cost 4.
C(p_1)=3, C(p_2)=4. Now, increment every edge by 1. Now, C(p_1)=6,
C(p_2)=5. Notice that p_1 was original cheaper, but after incrementing
is more expensive.
--
Alan Johnson This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: XMLGuy |
last post by:
I initially posted this question in comp.theory but did not get much
response. Please help! I think tree automata is very well studied area
in math and computer science. Tree automata is also used often in
context of XML and will appreciate your response and opinions about
using tree automata for XML.
I am looking for an algorithm that performs intersection operation on
two tree automatas. I unable to find any in textbooks or online....
|
by: _mario.lat |
last post by:
kruskal:minimum spanning tree. how to do?
I'd like to find the minimum spanning tree with kruskal algorithm.
There is a code (in C++) written?
which contenitor do you suggest (Vector, set, ...)?
How can I do?
Thank you in advance, Mario.
|
by: dam_fool_2003 |
last post by:
I am just a beginner in tree data – struct. I have this little doubt.
Left node ‘weights' lesser than the right one. I have seen, so far it
is algorithm implementations. But why not vice-versa that is right
node ‘weights' lesser than the left one? Why the trees are implemented
in that way? Can any body clarify?
Thanks in advance
|
by: Aris |
last post by:
Hello!
This is my problem.
I'm trying to make an inorder traversal algorithm for
a binary tree, not a recursive one, but using a stack.
Till now I got this:
void traverse(tree * p)
{
l: if(p==0) goto s;
push(p);
|
by: delraydog |
last post by:
It's quite simple to walk to the DOM tree going forward however I can't
figure out a nice clean way to walk the DOM tree in reverse. Checking
previousSibling is not sufficient as the previousSibling could be a
node which has childNodes and therefore the 'true' previousSibling
would be the *deepest* lastChild of the previousSibling...
For example, given this graph:
1 myAnchor nodeType 1
2 myAnchorText1 nodeType 3
| |
by: raylopez99 |
last post by:
What's the best way of implementing a multi-node tree in C++? What I'm
trying to do is traverse a tree of possible chess moves given an intial
position (at the root of the tree). Since every chess position has
around 30 moves, it would mean every node of the tree would have 30
branches (on average), which in turn themselves would average about 30
branches each.
I can think of a variety of ways of implementing this, including a
series...
|
by: jenny22 |
last post by:
i have a problem i am very new to c++ and want to construct a minimum spanning tree for 8 stocks i have calculated in excel the relevant formulas and know the weights of each of gthe vertices but don't know how to construct it i have read numerous books and have managed to get a pseudo code for how it should be which is
Algorithm spanningTree (graph)
Determine the minimum spanning tree a network.
Pre graph contains a network
Post...
|
by: slizorn |
last post by:
hi guys,
i need to make a tree traversal algorithm that would help me search the tree..
basically i need to read in a text file... shown below
H
H,E,L
E,B,F
B,A,C
A,null,null
c,null,D
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |