[Numpy-discussion] Graph class
davidgrant at gmail.com
Tue Aug 1 15:36:16 CDT 2006
I actually just looked into the boost graph library and hit a wall. I
basically had trouble running bjam on it. It complained about a missing
build file or something like that.
Anyways, for now I can live with non-sparse implementation. This is mostly
prototyping code for integeration in to a largely Java system (with some
things written in C). So this will be ported to Java or C eventually.
Whether or not I will need to protoype something that scales to thousands of
nodes remains to be seen.
On 8/1/06, Charles R Harris <charlesr.harris at gmail.com> wrote:
> Hi David,
> I often have several thousand nodes in a graph, sometimes clustered into
> connected components. I suspect that using an adjacency matrix is an
> inefficient representation for graphs of that size while for smaller graphs
> the overhead of more complicated structures wouldn't be noticeable. Have you
> looked at the boost graph library? I don't like all their stuff but it is a
> good start with lots of code and a suitable license.
> On 8/1/06, David Grant <davidgrant at gmail.com> wrote:
> > I have written my own graph class, it doesn't really do much, just has a
> few methods, it might do more later. Up until now it has just had one piece
> of data, an adjacency matrix, so it looks something like this:
> class Graph:
> def __init__(self, Adj):
> self.Adj = Adj
> I had the idea of changing Graph to inherit numpy.ndarray instead, so then
> I can just access itself directly rather than having to type self.Adj. Is
> this the right way to go about it? To inherit from numpy.ndarray?
> The reason I'm using a numpy array to store the graph by the way is the
> -Memory is not a concern (yet) so I don't need to use a sparse structure
> like a sparse array or a dictionary
> -I run a lot of sums on it, argmin, blanking out of certain rows and
> columns using fancy indexing, grabbing subgraphs using vector indexing
> David Grant
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> opinions on IT & business topics through brief surveys -- and earn cash
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion