<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Help me traverse a network of data.</title>
	<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data/</link>
	<description>Comments on Ask MetaFilter post Help me traverse a network of data.</description>
	<pubDate>Thu, 12 Feb 2009 04:29:08 -0800</pubDate>
	<lastBuildDate>Thu, 12 Feb 2009 04:29:08 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Help me traverse a network of data.</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data</link>	
		<description>Data/Python/Other programming filter: How do I construct and traverse a simple network of data? &lt;br /&gt;&lt;br /&gt; I have a large list of numbered nodes, with corresponding values between them. I would like to be able to find out the total value between any two nodes. For example:&lt;br&gt;
&lt;br&gt;
n1 to n2 = 5&lt;br&gt;
n2 to n3 = 2&lt;br&gt;
n2 to n4 = 6&lt;br&gt;
&lt;br&gt;
So the total of n1 to n4 = 5 + 6, and the total of n1 to n3 = 5 + 2.&lt;br&gt;
&lt;br&gt;
I am struggling to figure out exactly what this problem would be called to google it. I have been having a play in python but can&apos;t quite figure out how to approach the problem.&lt;br&gt;
&lt;br&gt;
Does anyone have any experience doing something like this, and know of a resource/have any tips for me?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2009:site.114023</guid>
		<pubDate>Thu, 12 Feb 2009 04:11:37 -0800</pubDate>
		<dc:creator>latentflip</dc:creator>
		
			<category>data</category>
		
			<category>programming</category>
		
			<category>python</category>
		
			<category>datanetworks</category>
		
			<category>resolved</category>
		
	</item> <item>
		<title>By: themel</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data#1637545</link>	
		<description>I assume that you&apos;re looking for &lt;a href=&quot;http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm&quot;&gt;Dijkstra&apos;s algorithm&lt;/a&gt;, though your description of the graphs isn&apos;t quite sufficient to figure out whether they a) satisfy the requirements and b) require the full mechanism.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114023-1637545</guid>
		<pubDate>Thu, 12 Feb 2009 04:29:08 -0800</pubDate>
		<dc:creator>themel</dc:creator>
	</item><item>
		<title>By: ghost of a past number</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data#1637546</link>	
		<description>I believe graph is the search term you are looking for. I would suggest implementing it in lisp for shits and giggles.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114023-1637546</guid>
		<pubDate>Thu, 12 Feb 2009 04:29:17 -0800</pubDate>
		<dc:creator>ghost of a past number</dc:creator>
	</item><item>
		<title>By: Harald74</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data#1637547</link>	
		<description>If I read you correctly, you&apos;ve got a cost tree, usually refered to as &quot;minimum cost tree&quot;, and used for routing of different kinds.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114023-1637547</guid>
		<pubDate>Thu, 12 Feb 2009 04:29:41 -0800</pubDate>
		<dc:creator>Harald74</dc:creator>
	</item><item>
		<title>By: fleacircus</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data#1637556</link>	
		<description>You can start digging on &lt;a href=&quot;http://mathworld.wolfram.com/All-PairsShortestPath.html&quot;&gt;All-Pairs Shortest Path&lt;/a&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114023-1637556</guid>
		<pubDate>Thu, 12 Feb 2009 04:48:03 -0800</pubDate>
		<dc:creator>fleacircus</dc:creator>
	</item><item>
		<title>By: latentflip</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data#1637558</link>	
		<description>It&apos;s actually just a huge list of resistors. There should only be one path between any two nodes, it will just be made up of lots of individual sections.&lt;br&gt;
&lt;br&gt;
I will have a look into Dijkstra&apos;s algorithm tho, as it should presumably work with just one path.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114023-1637558</guid>
		<pubDate>Thu, 12 Feb 2009 04:53:20 -0800</pubDate>
		<dc:creator>latentflip</dc:creator>
	</item><item>
		<title>By: Netzapper</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data#1637563</link>	
		<description>It&apos;s probably not a &quot;network&quot;, but a &quot;graph&quot;.  A &quot;network&quot; tends to refer to an interconnected group of thingies that do stuff and then pass the results on to another thingie; a &quot;graph&quot; tends to refer to a datastructure with nodes and connections, where you&apos;re analyzing attributes of the nodes and connections.&lt;br&gt;
&lt;br&gt;
And, as themel mentioned, &lt;a href=&quot;http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm&quot;&gt;Dijkstra&apos;s algorithm&lt;/a&gt; is the (provably) best algorithm for finding minimum paths through a graph.  That wikipedia link even has sample Python code.&lt;br&gt;
&lt;br&gt;
However, I don&apos;t know if your data structure is actually a graph, nor if what you&apos;re talking about is actually the shortest path.  Generally a graph is defined as a set of nodes, and a set of edges.  The nodes are just {n1, n2, n3, n4, n5, ...}, while the edges are {e1=(n1, n2), e2=(n1, n3), e3=(n2, n3), e4=(n2, n4), e5=(n4, n5)}.  Since you talk about costs between them, you would then have a set of weights {(e1, 2), (e2, 2), (e3, 242), (e4, 12), (e5, 2)}.  If we drew this, using crappy ascii graphics, we&apos;d have something like this:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[2]&amp;nbsp;&amp;nbsp;&amp;nbsp;[12]&amp;nbsp;&amp;nbsp;&amp;nbsp;[2]&lt;br&gt;
n1-----n2-----n4----n5&lt;br&gt;
&amp;nbsp;&amp;nbsp;\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br&gt;
2]&amp;nbsp;\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;| [242]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;\&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;|&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;n3&lt;br&gt;
&lt;br&gt;
Dijkstra is then capable of saying that the shortest path between n1 and n5 is (n1, n2, n4, n5) with a cost of 16.  This is obvious to a human, but without an algorithm, the computer has no idea that (n1, n3, n2, n4, n5) isn&apos;t equally cheap.  Dijkstra does better than simply testing all the routes and keeping the best.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114023-1637563</guid>
		<pubDate>Thu, 12 Feb 2009 04:58:04 -0800</pubDate>
		<dc:creator>Netzapper</dc:creator>
	</item><item>
		<title>By: ijoshua</title>
		<link>http://ask.metafilter.com/114023/Help-me-traverse-a-network-of-data#1637901</link>	
		<description>Since you mentioned Python, you might find some the available graph libraries useful. Check out &lt;a href=&quot;http://networkx.lanl.gov/&quot;&gt;NetworkX&lt;/a&gt; or &lt;a href=&quot;http://code.google.com/p/python-graph/&quot;&gt;python-graph&lt;/a&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2009:site.114023-1637901</guid>
		<pubDate>Thu, 12 Feb 2009 11:11:30 -0800</pubDate>
		<dc:creator>ijoshua</dc:creator>
	</item>
	</channel>
</rss>
