Talk:Johnson's algorithm
This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
|
De-Plagiarize
[edit]The algorithm is taken word for word from the second reference in case anyone wants to reword it or something. Fluxbyte (talk) 01:26, 1 April 2008 (UTC)
- I've completely rewritten it. —David Eppstein (talk) 23:56, 4 April 2008 (UTC)
DANN
[edit]I removed a link to the DANN library, which claims to have an implementation of Johnson's algorithm. However, it has been spammed very recently to many Wikipedia articles. Additionally, it is a bad implementation: for each edge in the graph, it reweights it by finding a description of the entire path from the start vertex to each endpoint of the edge before calculating the weight of the edge. Although not an asymptotic slowdown because other parts of the algorithm are as slow in the worst case, this causes it to take O(n) per edge reweight step whereas the correct algorithm should just look up the weight and perform the reweight in constant time. The net effect is that even on graphs where the Bellman-Ford part uses few iterations (most of them), the reweighting part will slow it down. —David Eppstein (talk) 06:16, 1 November 2009 (UTC)
- (Later) Add to which their implementation of Bellman-Ford is stupid and doesn't terminate early once the distances stop changing. So it always takes Θ(mn) time even on graphs for which it should run much more quickly. —David Eppstein (talk) 07:14, 1 November 2009 (UTC)
- Im the original person who posted the links (the time it was claimed to be spam). It was not spam it was part of many hours of research and surfing trying to find pages that seem to have an incomplete listed of resources. The links were all from many sources I felt, as a professional int he field, are important. You reverted my links and i let it stand even though i put hard work into it. Your revert was re-reverted here by someone else and you guys got into a revert war. I think its important these things are discussed, but your explanation constitutes Original Research so i must object. This library seems to hit on the top of google for many of the search terms i can come up with and yet there are no websites discrediting this source, and the project seems to have been open source for over 3 years. In the spirit of Wikipedia we should try to avoid original resource and use these other aspects to judge the resources we provide.98.23.60.15 (talk) 06:31, 1 November 2009 (UTC)
- I don't see how the amount of effort you may have spent is relevant to whether these links are worth including. —David Eppstein (talk) 07:14, 1 November 2009 (UTC)
- The effort isnt what was important but rather the result of that effort. Firstly the effort consisted of finding generally well respected links I could. All the links (dANN included) were top hitting on google, seemed to have the most activity, the longest activity, and had no bad references I could find. In the case of the dANN link it seems to have received good attention, hits first on the relevant search terms, has public space for any objections or bugs to be shown, etc. The problems you speak of dont show up in the bugs section, anyone could have posted such a bug and had it reviewed. A proper way to debunk the viability of the library in a way that didnt show Original Research would be to point to various outstanding bug reports for this section of the source, or any source discrediting it really. You seem unusually defensive and i appologize if that is my fault, comments like that arent productive and didnt address my points.98.23.60.15 (talk) 07:23, 1 November 2009 (UTC)
- WP:OR is not the guideline you should be looking at. Try WP:EL. You should be the one explaining (by something a little more convincing than "I couldn't find a bug report") why these links are of sufficient importance to the subject to be worth including. And remember, Wikipedia is not a linkfarm: we're not here to collect all potentially-useful links, that's for sites like dmoz. As for your amateur psychology, don't give up the day job. —David Eppstein (talk) 07:30, 1 November 2009 (UTC)
- Im trying to be civil with you, its sad to see you reduce it to childish insults. I have not once taken this to personal attacks on you. I have tried to tell you why this is a good link as per WP:ELYES. I have demonstrated various factors to show that this is most likely accurate material. The exposure of the project, combined with 3 years activity, and public space where possible problems could be posted. When enough eyes are on a project for such a long time, especially on open source project where there is a public space to help expose any problems, problems tend to show up. Another words, its popularity, and exposure is enough to be credible in the absence of evidence to the contrary. You cant assume a popular well reviewed project to be faulty without some other well respected resource showing that.98.23.60.15 (talk) 07:39, 1 November 2009 (UTC)
- I also want to point out this article has no Psudocode it also doesnt include implementations of this algorithm in general. In the future as these sections were created id expect this and other links/references to be moved to that listing. Until this happens this link serves an important purpose of showing a popular implementation and source.98.23.60.15 (talk) 07:54, 1 November 2009 (UTC)
- WP:OR is not the guideline you should be looking at. Try WP:EL. You should be the one explaining (by something a little more convincing than "I couldn't find a bug report") why these links are of sufficient importance to the subject to be worth including. And remember, Wikipedia is not a linkfarm: we're not here to collect all potentially-useful links, that's for sites like dmoz. As for your amateur psychology, don't give up the day job. —David Eppstein (talk) 07:30, 1 November 2009 (UTC)
- The effort isnt what was important but rather the result of that effort. Firstly the effort consisted of finding generally well respected links I could. All the links (dANN included) were top hitting on google, seemed to have the most activity, the longest activity, and had no bad references I could find. In the case of the dANN link it seems to have received good attention, hits first on the relevant search terms, has public space for any objections or bugs to be shown, etc. The problems you speak of dont show up in the bugs section, anyone could have posted such a bug and had it reviewed. A proper way to debunk the viability of the library in a way that didnt show Original Research would be to point to various outstanding bug reports for this section of the source, or any source discrediting it really. You seem unusually defensive and i appologize if that is my fault, comments like that arent productive and didnt address my points.98.23.60.15 (talk) 07:23, 1 November 2009 (UTC)
- I don't see how the amount of effort you may have spent is relevant to whether these links are worth including. —David Eppstein (talk) 07:14, 1 November 2009 (UTC)
(unindent) If you're trying to be civil, could you please avoid the repeated ad hominem attacks and stick to the subject? I refer specifically to "you seem unusually defensive" and "sad to see you reduce it to childish attacks". And yes, I am allowed to describe why I find the project's implementation of this algorithm to be faulty: if I were writing that criticism in a Wikipedia article about the project then of course it would need to be sourced but it's perfectly valid as a judgement on how worthwhile it would be to include it as a link. As for why such faults would not have shown up already in the three-year history of the project, I can only hazard a few guesses: because it's not as widely used as you imply? Because these faults do not affect the correctness of the algorithm, only its runtime? Because they're in a part of the library that's infrequently used? Because it has not undergone a previous critical review by someone looking at how its implementation choices affect its runtime? In any case as you stated earlier I've reverted past where I probably should have stopped, so I'm not going to keep edit warring about this. Instead, as an attempt to break this deadlock, I'm asking on Wikipedia talk:WikiProject Computer science for additional opinions on the matter. —David Eppstein (talk) 08:01, 1 November 2009 (UTC)
- remarking to your defensiveness was never meant to be an attack, and im sorry you felt it was. As a PhD its easy for me to evaluate the algorithm myself. But in the spirit of being neural and avoiding Personal Research to judge a resource I prefer to refer to the community reception to such a product. Personally I prefer anonymity so our contributions speak for themselves and to try to reduce personal opinions. I hope we can get more attention on this topic and reach a consensus.98.23.60.15 (talk) 08:09, 1 November 2009 (UTC)
- Is the library mentioned in some scientific publications or books? If not, we shouldn't link to this library in Wikipedia. Andreas Kaufmann (talk) 09:18, 1 November 2009 (UTC)
- This definitely does look like link spam or advertisement to me. There doesn't seem to be any reason to believe that this implementation is credible enough to have an external link. Offliner (talk) 08:13, 1 November 2009 (UTC)
- The link does not seem to satisfy WP:ELYES or WP:ELMAYBE, so we should remove it. (If there were reliable sources that tell that DANN is one of the best implementations of Johnson's algorithm, then we might consider mentioning DANN in the article. However, such sources don't seem to exist.) — Miym (talk) 10:55, 1 November 2009 (UTC)
Hi guys, someone sent me an e-mail pointing me to this discussion and asking my help. I am the owner of Syncleus and the lead developer on dANN. The email sent to me asking for help was requesting sources and pointed me to this discussion. While I'm very happy to see at least 2 editors showing an interest in dANN and trying to help others by sharing it; I'm afraid i must agree with David. The Johnson's Algorithm along with the entire graphing section of the library is still unstable and exists only in the SVN for a reason. While the overall project is rather old, and some parts are somewhat mature, Johnson's Algorithm doesn't fall under that category yet. It has not been reviewed by many people or used in any major software yet, or even released outside of SVN for that matter. I hope this helps resolve any problems you guys might be having and feel free to contact me if i can be of further assistance. - Debeo Morium: to be morally bound (Talk | Contribs) 19:39, 1 November 2009 (UTC)
Reweighting Results in Non-Negative Edge Weights?
[edit]The "Algorithm description" section ]says that reweighting results in non-negative edge weights, but I don't see why. I think this part needs clarification. I added a [citation-needed], which probably isn't the exactly the right thing, but I wasn't sure how else to call attention to that part. I'm not sure if that part actually needs citation if proof is provided, but it couldn't hurt.
Also, I added some explanation for the assertion that h(s) - h(t) is added to the weight of every s-t path after reweighting. The math needs to be properly formatted though; unfortunately, I don't know how to do that. It would be great if someone were to fix that.
--Danielx (talk) 06:00, 22 February 2011 (UTC)
- I added an explanation and formatted the math. Hope that helps. —David Eppstein (talk) 06:44, 22 February 2011 (UTC)
- If it helps, here's a more mathematical way to show the weights will be non negative after reweighting. This is paraphrased from the explanation in CLRS third edition, p702... let h(v) be the shortest path weight delta(q,v) where q is the new dummy node we added. Due to triangular inequality, when we compute the shortest path weights using Dijkstra, as we relax edges, we guarantee that h(v) <= h(u) + w(u,v). Let's say we use the reweighting function w'(u,v)= w(u,v) + h(u) - h(v). We can see here that if h(v) is as large as it can be (in this case equal to h(u) + w(u,v) ) then the terms in w'(u,v) will cancel out and we have that h(v) is equal to zero. If h(v) is less than that (less than h(u) + w(u,v) ) then w'(u,v) can only be greater than zero. Therefore w'(u,v) is always >= zero in the reweighting (that is to say, non-negative).. — Preceding unsigned comment added by 166.147.72.150 (talk) 03:15, 10 October 2012 (UTC)
First two steps of Johnson's algorithm
[edit]Perhaps I'm missing something, but the first two steps don't really make any sense. If you add a new fake source node to the graph with zero weight edges to each other vertex, then the minimum weight shortest path from q to v for any v in the graph will be zero with edge/path length of one (just follow the new fake path edge from q to v with weight zero for some v, and that's now the shortest path from q to v.."
I think the first two steps need to be reworded. It seems as though it's trying to say "ignore the extra zero weight edge added from q to v when finding the shortest path from q to v, but consider all other paths as fair game including the other zero weight paths from the fake source leading to some other u where u is not equal to v". Or perhaps it said that, but I missed it?
These are the two steps that need clarification of that fact (otherwise IMHO it makes no sense):
"...First, a new node q is added to the graph, connected by zero-weight edges to each of the other nodes. Second, the Bellman–Ford algorithm is used, starting from the new vertex q, to find for each vertex v the minimum weight h(v) of a path from q to v. If this step detects a negative cycle, the algorithm is terminated..." — Preceding unsigned comment added by 76.184.141.23 (talk) 04:41, 4 October 2012 (UTC)
- You are incorrect when you say "the minimum weight shortest path from q to v for any v in the graph will be zero". It will be at most zero, but it might be negative. —David Eppstein (talk) 05:42, 4 October 2012 (UTC)
- Thanks, that was the missing emement; makes perfect sense now. Not sure why that was not obvious.. — Preceding unsigned comment added by 166.147.72.146 (talk) 02:06, 10 October 2012 (UTC)