This is perhaps also best filed as an issue against Graphs.jl.

-viral

On Friday, August 29, 2014 10:20:07 PM UTC+5:30, Ivan Raikov wrote:
>
> Hello,
>
>    I am trying to create a graph with 10500 vertices, and random 
> connections with uniform probability of 0.1,
> using Julia 0.3 and the Graphs package.
>
> The code below seems to run out of memory when it reaches i ~ 10000. Am I 
> doing something wrong here?
>
> using Graphs
>
> n = 10500
> p = 0.1
>
> function build(n,p)
>     gEx = graph([ ExVertex(x,string(x)) for x = 1:n ], ExEdge{ExVertex}[])
>     V = vertices(gEx)
>     eind = 1
>     for i = 1 : n
>         println ("i = ", i)
>         for j = 1 : n
>             if rand() < p
>                 d = AttributeDict ()
>                 d[utf8("weight")] = 0.1
>                 add_edge! (gEx, ExEdge (eind, V[i], V[j], d))
>                 eind = eind + 1
>             end
>         end
>     end
>     println (gEx)
>     gEx
> end
>
> build(n,p)
>
>
>

Reply via email to