Weight functions in graph algorithmsSabatier conjecturesShortest path that passes through specific node(s)Data structure for finding the sum of edge weights on a pathMinimum edge deletion partitioning of a planar graphGraph algorithms for vulnerability and optimality of networkWhat is the point of the “respect” requirement in cut property of minimum spanning tree?given a weighted, directed graph. Give an O(VE)-time algorithm to find, for each vertex v∈V, the value δ∗(v)=Min u∈Vδ(u,v)?Shortest path with positive edge cycleDijkstra's shortest path algorithm without relaxationLongest-path in a graph, where the path should be 'straight'
How important are the Author's mood and feelings for writing a story?
Weight functions in graph algorithms
Could a US citizen born through "birth tourism" become President?
Could Europeans in Europe demand protection under UN Declaration on the Rights of Indigenous Peoples?
Somebody hacked my clock
Simplest instruction set that has an c++/C compiler to write an emulator for?
Integration using partial fraction is wrong
Why isn't a binary file shown as 0s and 1s?
Did Hitler say this quote about homeschooling?
How do you send money when you're not sure it's not a scam?
What is a Kravchuk transform and how is it related to Fourier transforms?
How to not confuse readers with simultaneous events?
What could make large expeditions ineffective for exploring territory full of dangers and valuable resources?
Was demon possession only a New Testament phenomenon?
The most secure way to handle someone forgetting to verify their account?
Improving an O(N^2) function (all entities iterating over all other entities)
Is it possible to target 2 allies with the Warding Bond spell using the Sorcerer's Twinned Spell metamagic option?
Transistor power dissipation rating
"This used to be my phone number"
Who or what determines if a curse is valid or not?
Why do space operations use "nominal" to mean "working correctly"?
Do higher dimensions have axes?
How to tell readers that I know my story is factually incorrect?
Which modern firearm should a time traveler bring to be easily reproducible for a historic civilization?
Weight functions in graph algorithms
Sabatier conjecturesShortest path that passes through specific node(s)Data structure for finding the sum of edge weights on a pathMinimum edge deletion partitioning of a planar graphGraph algorithms for vulnerability and optimality of networkWhat is the point of the “respect” requirement in cut property of minimum spanning tree?given a weighted, directed graph. Give an O(VE)-time algorithm to find, for each vertex v∈V, the value δ∗(v)=Min u∈Vδ(u,v)?Shortest path with positive edge cycleDijkstra's shortest path algorithm without relaxationLongest-path in a graph, where the path should be 'straight'
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
In text books, for instance in the 3rd edition of Introduction to Algorithms, Cormen, on page 625, the weights of the edge set $E$ is defined with a weight function $w:Erightarrow mathbbR$.
Why is it defined in this way? Why do we need a function? I mean, we all know when working with a graph, that the meaning is just that an edge $(u,v)$ has a weight $w$. So, why is it written with a function? I remember the first time I saw this definition I was very confused. Only after actually going through an algorithm and reading it again, I realized that it really just means that every edge has its weight.
So, I still don't fully understand why it is written in this complicated way and what exactly it means though, and it would be very nice if someone could tell me that in a understandable language.
graphs weighted-graphs notation
New contributor
$endgroup$
add a comment |
$begingroup$
In text books, for instance in the 3rd edition of Introduction to Algorithms, Cormen, on page 625, the weights of the edge set $E$ is defined with a weight function $w:Erightarrow mathbbR$.
Why is it defined in this way? Why do we need a function? I mean, we all know when working with a graph, that the meaning is just that an edge $(u,v)$ has a weight $w$. So, why is it written with a function? I remember the first time I saw this definition I was very confused. Only after actually going through an algorithm and reading it again, I realized that it really just means that every edge has its weight.
So, I still don't fully understand why it is written in this complicated way and what exactly it means though, and it would be very nice if someone could tell me that in a understandable language.
graphs weighted-graphs notation
New contributor
$endgroup$
add a comment |
$begingroup$
In text books, for instance in the 3rd edition of Introduction to Algorithms, Cormen, on page 625, the weights of the edge set $E$ is defined with a weight function $w:Erightarrow mathbbR$.
Why is it defined in this way? Why do we need a function? I mean, we all know when working with a graph, that the meaning is just that an edge $(u,v)$ has a weight $w$. So, why is it written with a function? I remember the first time I saw this definition I was very confused. Only after actually going through an algorithm and reading it again, I realized that it really just means that every edge has its weight.
So, I still don't fully understand why it is written in this complicated way and what exactly it means though, and it would be very nice if someone could tell me that in a understandable language.
graphs weighted-graphs notation
New contributor
$endgroup$
In text books, for instance in the 3rd edition of Introduction to Algorithms, Cormen, on page 625, the weights of the edge set $E$ is defined with a weight function $w:Erightarrow mathbbR$.
Why is it defined in this way? Why do we need a function? I mean, we all know when working with a graph, that the meaning is just that an edge $(u,v)$ has a weight $w$. So, why is it written with a function? I remember the first time I saw this definition I was very confused. Only after actually going through an algorithm and reading it again, I realized that it really just means that every edge has its weight.
So, I still don't fully understand why it is written in this complicated way and what exactly it means though, and it would be very nice if someone could tell me that in a understandable language.
graphs weighted-graphs notation
graphs weighted-graphs notation
New contributor
New contributor
edited 6 hours ago
Apass.Jack
18.4k2 gold badges13 silver badges47 bronze badges
18.4k2 gold badges13 silver badges47 bronze badges
New contributor
asked 9 hours ago
RichArtRichArt
1063 bronze badges
1063 bronze badges
New contributor
New contributor
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
It means that each edge has only one weight, which is defined as a real number.
So, this definition in compact form excludes many cases, for example:
- an edge doesn't have weight at all
- an edge has two (or more) weights
- an edge has weight as a complex number
- etc.
$endgroup$
add a comment |
$begingroup$
Here is the original statement in CLRS.
Assume that we have a connected, undirected graph $G$ with a weight function $w: EtoBbb R$, and we wish to find a minimum spanning tree for $G$.
It is pretty good to understand "a weight function $w:Erightarrow mathbbR$" as "an edge has a weight". In fact, that is how I would read that notation immediately. I would encourage you to keep this primitive understanding, in an attempt to form the most compact and natural representation of knowledge in your mind.
While that simple and natural understanding is probably enough to understand the setup for that section of the book, that mathematical notation has some distinct advantages.
In general, although expressive and colorful, natural languages or thoughts, are more complex and abound with ambiguity and arbitrary vagueness. If "an edge $(u,v)$ has a weight $w$", could the edge $(u,v)$ also has two different weight? Is weight something like "6 pounds", "12 dollars", or "3 miles"? If edge $(u,v')$ is not edge $(u,v)$, do I have to use the same symbol $w$ for the weight of $(u,v')$ or should I use a different symbol? While these questions may or may not pose a problem for you, it might for other readers of the book.
On the other hand, the notation "$w: EtoBbb R$" defines exactly what is the domain, codomain and the kind of correspondence of a relation. To be pedantic, it means the symbol/entity $w$ associates to every element of $E$, i.e, an edge of $G$ exactly one element of $R$, i.e, a real number. There is no room to err.
Moving down the road, page 648 of the book presents the following formula.
$beginaligned
w(T') &= w(T) - w(x,y) + w(u,v)\
&le w(T)
endaligned$
You can try to express the facts embodied in the above formula in plain English. You may need three or even ten times longer statements to express with the same rigor and clarity. You cannot be more visually appealing. That is how the notation $w:EtoBbb R$ shines.
The power of mathematics notations, including notations in computer science, is what you would like to master if you want to dive further into the mathematics, computer science and many other subjects where symbolic computations are needed and useful. In a sense, notations like this are beautiful data types. You can get familiar with them. You can become comfortable with them.
$endgroup$
$begingroup$
So, how do you actually read in plain English $w:Erightarrow mathbbR$ ? Can you update it in your answer above?
$endgroup$
– RichArt
2 hours ago
add a comment |
$begingroup$
There are many problems which are solvable in the unweighted version but not for weighted version. Here they consider weighted version.
$endgroup$
$begingroup$
Solvable in what sense; did you mean efficiently? Still, this doesn't strictly answer the question which is "why this notation" and not "why weights".
$endgroup$
– Juho
5 hours ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "419"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
RichArt is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f112017%2fweight-functions-in-graph-algorithms%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
It means that each edge has only one weight, which is defined as a real number.
So, this definition in compact form excludes many cases, for example:
- an edge doesn't have weight at all
- an edge has two (or more) weights
- an edge has weight as a complex number
- etc.
$endgroup$
add a comment |
$begingroup$
It means that each edge has only one weight, which is defined as a real number.
So, this definition in compact form excludes many cases, for example:
- an edge doesn't have weight at all
- an edge has two (or more) weights
- an edge has weight as a complex number
- etc.
$endgroup$
add a comment |
$begingroup$
It means that each edge has only one weight, which is defined as a real number.
So, this definition in compact form excludes many cases, for example:
- an edge doesn't have weight at all
- an edge has two (or more) weights
- an edge has weight as a complex number
- etc.
$endgroup$
It means that each edge has only one weight, which is defined as a real number.
So, this definition in compact form excludes many cases, for example:
- an edge doesn't have weight at all
- an edge has two (or more) weights
- an edge has weight as a complex number
- etc.
answered 8 hours ago
HEKTOHEKTO
1,3658 silver badges15 bronze badges
1,3658 silver badges15 bronze badges
add a comment |
add a comment |
$begingroup$
Here is the original statement in CLRS.
Assume that we have a connected, undirected graph $G$ with a weight function $w: EtoBbb R$, and we wish to find a minimum spanning tree for $G$.
It is pretty good to understand "a weight function $w:Erightarrow mathbbR$" as "an edge has a weight". In fact, that is how I would read that notation immediately. I would encourage you to keep this primitive understanding, in an attempt to form the most compact and natural representation of knowledge in your mind.
While that simple and natural understanding is probably enough to understand the setup for that section of the book, that mathematical notation has some distinct advantages.
In general, although expressive and colorful, natural languages or thoughts, are more complex and abound with ambiguity and arbitrary vagueness. If "an edge $(u,v)$ has a weight $w$", could the edge $(u,v)$ also has two different weight? Is weight something like "6 pounds", "12 dollars", or "3 miles"? If edge $(u,v')$ is not edge $(u,v)$, do I have to use the same symbol $w$ for the weight of $(u,v')$ or should I use a different symbol? While these questions may or may not pose a problem for you, it might for other readers of the book.
On the other hand, the notation "$w: EtoBbb R$" defines exactly what is the domain, codomain and the kind of correspondence of a relation. To be pedantic, it means the symbol/entity $w$ associates to every element of $E$, i.e, an edge of $G$ exactly one element of $R$, i.e, a real number. There is no room to err.
Moving down the road, page 648 of the book presents the following formula.
$beginaligned
w(T') &= w(T) - w(x,y) + w(u,v)\
&le w(T)
endaligned$
You can try to express the facts embodied in the above formula in plain English. You may need three or even ten times longer statements to express with the same rigor and clarity. You cannot be more visually appealing. That is how the notation $w:EtoBbb R$ shines.
The power of mathematics notations, including notations in computer science, is what you would like to master if you want to dive further into the mathematics, computer science and many other subjects where symbolic computations are needed and useful. In a sense, notations like this are beautiful data types. You can get familiar with them. You can become comfortable with them.
$endgroup$
$begingroup$
So, how do you actually read in plain English $w:Erightarrow mathbbR$ ? Can you update it in your answer above?
$endgroup$
– RichArt
2 hours ago
add a comment |
$begingroup$
Here is the original statement in CLRS.
Assume that we have a connected, undirected graph $G$ with a weight function $w: EtoBbb R$, and we wish to find a minimum spanning tree for $G$.
It is pretty good to understand "a weight function $w:Erightarrow mathbbR$" as "an edge has a weight". In fact, that is how I would read that notation immediately. I would encourage you to keep this primitive understanding, in an attempt to form the most compact and natural representation of knowledge in your mind.
While that simple and natural understanding is probably enough to understand the setup for that section of the book, that mathematical notation has some distinct advantages.
In general, although expressive and colorful, natural languages or thoughts, are more complex and abound with ambiguity and arbitrary vagueness. If "an edge $(u,v)$ has a weight $w$", could the edge $(u,v)$ also has two different weight? Is weight something like "6 pounds", "12 dollars", or "3 miles"? If edge $(u,v')$ is not edge $(u,v)$, do I have to use the same symbol $w$ for the weight of $(u,v')$ or should I use a different symbol? While these questions may or may not pose a problem for you, it might for other readers of the book.
On the other hand, the notation "$w: EtoBbb R$" defines exactly what is the domain, codomain and the kind of correspondence of a relation. To be pedantic, it means the symbol/entity $w$ associates to every element of $E$, i.e, an edge of $G$ exactly one element of $R$, i.e, a real number. There is no room to err.
Moving down the road, page 648 of the book presents the following formula.
$beginaligned
w(T') &= w(T) - w(x,y) + w(u,v)\
&le w(T)
endaligned$
You can try to express the facts embodied in the above formula in plain English. You may need three or even ten times longer statements to express with the same rigor and clarity. You cannot be more visually appealing. That is how the notation $w:EtoBbb R$ shines.
The power of mathematics notations, including notations in computer science, is what you would like to master if you want to dive further into the mathematics, computer science and many other subjects where symbolic computations are needed and useful. In a sense, notations like this are beautiful data types. You can get familiar with them. You can become comfortable with them.
$endgroup$
$begingroup$
So, how do you actually read in plain English $w:Erightarrow mathbbR$ ? Can you update it in your answer above?
$endgroup$
– RichArt
2 hours ago
add a comment |
$begingroup$
Here is the original statement in CLRS.
Assume that we have a connected, undirected graph $G$ with a weight function $w: EtoBbb R$, and we wish to find a minimum spanning tree for $G$.
It is pretty good to understand "a weight function $w:Erightarrow mathbbR$" as "an edge has a weight". In fact, that is how I would read that notation immediately. I would encourage you to keep this primitive understanding, in an attempt to form the most compact and natural representation of knowledge in your mind.
While that simple and natural understanding is probably enough to understand the setup for that section of the book, that mathematical notation has some distinct advantages.
In general, although expressive and colorful, natural languages or thoughts, are more complex and abound with ambiguity and arbitrary vagueness. If "an edge $(u,v)$ has a weight $w$", could the edge $(u,v)$ also has two different weight? Is weight something like "6 pounds", "12 dollars", or "3 miles"? If edge $(u,v')$ is not edge $(u,v)$, do I have to use the same symbol $w$ for the weight of $(u,v')$ or should I use a different symbol? While these questions may or may not pose a problem for you, it might for other readers of the book.
On the other hand, the notation "$w: EtoBbb R$" defines exactly what is the domain, codomain and the kind of correspondence of a relation. To be pedantic, it means the symbol/entity $w$ associates to every element of $E$, i.e, an edge of $G$ exactly one element of $R$, i.e, a real number. There is no room to err.
Moving down the road, page 648 of the book presents the following formula.
$beginaligned
w(T') &= w(T) - w(x,y) + w(u,v)\
&le w(T)
endaligned$
You can try to express the facts embodied in the above formula in plain English. You may need three or even ten times longer statements to express with the same rigor and clarity. You cannot be more visually appealing. That is how the notation $w:EtoBbb R$ shines.
The power of mathematics notations, including notations in computer science, is what you would like to master if you want to dive further into the mathematics, computer science and many other subjects where symbolic computations are needed and useful. In a sense, notations like this are beautiful data types. You can get familiar with them. You can become comfortable with them.
$endgroup$
Here is the original statement in CLRS.
Assume that we have a connected, undirected graph $G$ with a weight function $w: EtoBbb R$, and we wish to find a minimum spanning tree for $G$.
It is pretty good to understand "a weight function $w:Erightarrow mathbbR$" as "an edge has a weight". In fact, that is how I would read that notation immediately. I would encourage you to keep this primitive understanding, in an attempt to form the most compact and natural representation of knowledge in your mind.
While that simple and natural understanding is probably enough to understand the setup for that section of the book, that mathematical notation has some distinct advantages.
In general, although expressive and colorful, natural languages or thoughts, are more complex and abound with ambiguity and arbitrary vagueness. If "an edge $(u,v)$ has a weight $w$", could the edge $(u,v)$ also has two different weight? Is weight something like "6 pounds", "12 dollars", or "3 miles"? If edge $(u,v')$ is not edge $(u,v)$, do I have to use the same symbol $w$ for the weight of $(u,v')$ or should I use a different symbol? While these questions may or may not pose a problem for you, it might for other readers of the book.
On the other hand, the notation "$w: EtoBbb R$" defines exactly what is the domain, codomain and the kind of correspondence of a relation. To be pedantic, it means the symbol/entity $w$ associates to every element of $E$, i.e, an edge of $G$ exactly one element of $R$, i.e, a real number. There is no room to err.
Moving down the road, page 648 of the book presents the following formula.
$beginaligned
w(T') &= w(T) - w(x,y) + w(u,v)\
&le w(T)
endaligned$
You can try to express the facts embodied in the above formula in plain English. You may need three or even ten times longer statements to express with the same rigor and clarity. You cannot be more visually appealing. That is how the notation $w:EtoBbb R$ shines.
The power of mathematics notations, including notations in computer science, is what you would like to master if you want to dive further into the mathematics, computer science and many other subjects where symbolic computations are needed and useful. In a sense, notations like this are beautiful data types. You can get familiar with them. You can become comfortable with them.
answered 6 hours ago
Apass.JackApass.Jack
18.4k2 gold badges13 silver badges47 bronze badges
18.4k2 gold badges13 silver badges47 bronze badges
$begingroup$
So, how do you actually read in plain English $w:Erightarrow mathbbR$ ? Can you update it in your answer above?
$endgroup$
– RichArt
2 hours ago
add a comment |
$begingroup$
So, how do you actually read in plain English $w:Erightarrow mathbbR$ ? Can you update it in your answer above?
$endgroup$
– RichArt
2 hours ago
$begingroup$
So, how do you actually read in plain English $w:Erightarrow mathbbR$ ? Can you update it in your answer above?
$endgroup$
– RichArt
2 hours ago
$begingroup$
So, how do you actually read in plain English $w:Erightarrow mathbbR$ ? Can you update it in your answer above?
$endgroup$
– RichArt
2 hours ago
add a comment |
$begingroup$
There are many problems which are solvable in the unweighted version but not for weighted version. Here they consider weighted version.
$endgroup$
$begingroup$
Solvable in what sense; did you mean efficiently? Still, this doesn't strictly answer the question which is "why this notation" and not "why weights".
$endgroup$
– Juho
5 hours ago
add a comment |
$begingroup$
There are many problems which are solvable in the unweighted version but not for weighted version. Here they consider weighted version.
$endgroup$
$begingroup$
Solvable in what sense; did you mean efficiently? Still, this doesn't strictly answer the question which is "why this notation" and not "why weights".
$endgroup$
– Juho
5 hours ago
add a comment |
$begingroup$
There are many problems which are solvable in the unweighted version but not for weighted version. Here they consider weighted version.
$endgroup$
There are many problems which are solvable in the unweighted version but not for weighted version. Here they consider weighted version.
answered 7 hours ago
Satyabrata JanaSatyabrata Jana
485 bronze badges
485 bronze badges
$begingroup$
Solvable in what sense; did you mean efficiently? Still, this doesn't strictly answer the question which is "why this notation" and not "why weights".
$endgroup$
– Juho
5 hours ago
add a comment |
$begingroup$
Solvable in what sense; did you mean efficiently? Still, this doesn't strictly answer the question which is "why this notation" and not "why weights".
$endgroup$
– Juho
5 hours ago
$begingroup$
Solvable in what sense; did you mean efficiently? Still, this doesn't strictly answer the question which is "why this notation" and not "why weights".
$endgroup$
– Juho
5 hours ago
$begingroup$
Solvable in what sense; did you mean efficiently? Still, this doesn't strictly answer the question which is "why this notation" and not "why weights".
$endgroup$
– Juho
5 hours ago
add a comment |
RichArt is a new contributor. Be nice, and check out our Code of Conduct.
RichArt is a new contributor. Be nice, and check out our Code of Conduct.
RichArt is a new contributor. Be nice, and check out our Code of Conduct.
RichArt is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Computer Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f112017%2fweight-functions-in-graph-algorithms%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown