<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Dijkstra&#8217;s Algorithm code in C++</title>
	<atom:link href="http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/</link>
	<description>Technology, life, programming, travel and money.</description>
	<lastBuildDate>Fri, 10 Feb 2012 14:53:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Dalir</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5907</link>
		<dc:creator>Dalir</dc:creator>
		<pubDate>Fri, 09 Dec 2011 14:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5907</guid>
		<description>thank you...</description>
		<content:encoded><![CDATA[<p>thank you&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tal</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5796</link>
		<dc:creator>tal</dc:creator>
		<pubDate>Sun, 02 Oct 2011 17:31:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5796</guid>
		<description>hi,
this code eventually works good, but its not effective.
for a complex senario, with 100000 nodes, this algorithem works truly bad.</description>
		<content:encoded><![CDATA[<p>hi,<br />
this code eventually works good, but its not effective.<br />
for a complex senario, with 100000 nodes, this algorithem works truly bad.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neutrino</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5778</link>
		<dc:creator>neutrino</dc:creator>
		<pubDate>Sun, 25 Sep 2011 09:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5778</guid>
		<description>Thank you very much buddy.</description>
		<content:encoded><![CDATA[<p>Thank you very much buddy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reviewmylife</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5714</link>
		<dc:creator>reviewmylife</dc:creator>
		<pubDate>Thu, 01 Sep 2011 00:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5714</guid>
		<description>Hi silverblade, I think you&#039;ll need to reset the previous and distanceFromStart variables in all the nodes before trying to calculate a new route.</description>
		<content:encoded><![CDATA[<p>Hi silverblade, I think you&#8217;ll need to reset the previous and distanceFromStart variables in all the nodes before trying to calculate a new route.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: silverblade</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5708</link>
		<dc:creator>silverblade</dc:creator>
		<pubDate>Wed, 31 Aug 2011 16:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5708</guid>
		<description>Hi thanks for the reply, currently the only way I can think of for this to do multiple iterations, is to reconstruct the weighted graph for every iteration, which is terribly inefficient.
Basically what I have now is:
Node* a = new Node(&#039;a&#039;);
Node* b = new Node(&#039;b&#039;);
Node* c = new Node(&#039;c&#039;);
Node* d = new Node(&#039;d&#039;);
Edge* e1 = new Edge(a, c, 1);
Edge* e2 = new Edge(a, d, 2);
Edge* e3 = new Edge(b, c, 2);
Edge* e4 = new Edge(c, d, 1);
//assume this is the 1st loop
a-&gt;distanceFromStart = 0; // set start node
Dijkstras();
PrintShortestRouteTo(d); //correct path printed
a-&gt;distanceFromStart = INT_MAX //attempts to un-set the start node
//assume this is the 2nd loop onwards
b-&gt;distanceFromStart = 0; // set new start node
Dijkstras();
PrintShortestRouteTo(d); // at this point it still shows the path for A to D
Any ideas as to why this is happening? Much thanks!</description>
		<content:encoded><![CDATA[<p>Hi thanks for the reply, currently the only way I can think of for this to do multiple iterations, is to reconstruct the weighted graph for every iteration, which is terribly inefficient. </p>
<p>Basically what I have now is:<br />
Node* a = new Node(&#8216;a&#8217;);<br />
Node* b = new Node(&#8216;b&#8217;);<br />
Node* c = new Node(&#8216;c&#8217;);<br />
Node* d = new Node(&#8216;d&#8217;);</p>
<p>Edge* e1 = new Edge(a, c, 1);<br />
Edge* e2 = new Edge(a, d, 2);<br />
Edge* e3 = new Edge(b, c, 2);<br />
Edge* e4 = new Edge(c, d, 1);</p>
<p>//assume this is the 1st loop<br />
a-&gt;distanceFromStart = 0; // set start node<br />
Dijkstras();<br />
PrintShortestRouteTo(d); //correct path printed<br />
a-&gt;distanceFromStart = INT_MAX //attempts to un-set the start node</p>
<p>//assume this is the 2nd loop onwards<br />
b-&gt;distanceFromStart = 0; // set new start node<br />
Dijkstras();<br />
PrintShortestRouteTo(d); // at this point it still shows the path for A to D</p>
<p>Any ideas as to why this is happening? Much thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reviewmylife</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5705</link>
		<dc:creator>reviewmylife</dc:creator>
		<pubDate>Wed, 31 Aug 2011 04:24:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5705</guid>
		<description>Hi silverblade, I went to look at the original code expecting to copy and paste it in here for you - but I discovered that I never wrote the cleanup code! I just left it as a TODO for later :o</description>
		<content:encoded><![CDATA[<p>Hi silverblade, I went to look at the original code expecting to copy and paste it in here for you &#8211; but I discovered that I never wrote the cleanup code! I just left it as a TODO for later :o</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: silverblade</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5704</link>
		<dc:creator>silverblade</dc:creator>
		<pubDate>Wed, 31 Aug 2011 04:09:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5704</guid>
		<description>Hi, is it possible to post the Node/Edge cleanup code? I&#039;m trying to get this to work in a do-while loop with different starting nodes, but somehow I can&#039;t seem to get it to work after the first iteration.
After the first iteration, the program seems to not bother about the new starting node and just uses the first start node for the rest of the program.</description>
		<content:encoded><![CDATA[<p>Hi, is it possible to post the Node/Edge cleanup code? I&#8217;m trying to get this to work in a do-while loop with different starting nodes, but somehow I can&#8217;t seem to get it to work after the first iteration.</p>
<p>After the first iteration, the program seems to not bother about the new starting node and just uses the first start node for the rest of the program.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5551</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Tue, 12 Jul 2011 08:54:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5551</guid>
		<description>ExtractSmallest() runs in linear time, so it is not very efficient. If you used a heap or binary search tree you can get the smallest much faster.</description>
		<content:encoded><![CDATA[<p>ExtractSmallest() runs in linear time, so it is not very efficient. If you used a heap or binary search tree you can get the smallest much faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: XP</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5464</link>
		<dc:creator>XP</dc:creator>
		<pubDate>Mon, 13 Jun 2011 07:36:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5464</guid>
		<description>Hi, nice work, but can someone supply a example on how would this be implemented in a c++/mfc dialog program...I&#039;m having problem with it....the vectors are not been updated...</description>
		<content:encoded><![CDATA[<p>Hi, nice work, but can someone supply a example on how would this be implemented in a c++/mfc dialog program&#8230;I&#8217;m having problem with it&#8230;.the vectors are not been updated&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reviewmylife</title>
		<link>http://www.reviewmylife.co.uk/blog/2008/07/15/dijkstras-algorithm-code-in-c/#comment-5344</link>
		<dc:creator>reviewmylife</dc:creator>
		<pubDate>Thu, 21 Apr 2011 00:58:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.reviewmylife.co.uk/blog/?p=69#comment-5344</guid>
		<description>Hi Eddy, Yes if you aren&#039;t using Visual Studio Express C++ 2010 you&#039;ll have to figure out what changes you need to make. Start with the first error message and fix each one until it works.
INT_MAX is not defined. Either find a header that includes this definition, or you might have to rename or define INT_MAX yourself.</description>
		<content:encoded><![CDATA[<p>Hi Eddy, Yes if you aren&#8217;t using Visual Studio Express C++ 2010 you&#8217;ll have to figure out what changes you need to make. Start with the first error message and fix each one until it works.</p>
<p>INT_MAX is not defined. Either find a header that includes this definition, or you might have to rename or define INT_MAX yourself.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

