-
Notifications
You must be signed in to change notification settings - Fork 185
Conversation
add docs for sparse_erdos_renyi Revert "add type declaration to match previous functions" This reverts commit 7f0cd59. moving to Distributions from StatsBase Merge pull request sbromberger#30 from JuliaGraphs/distributions Merge branch 'master' of git://github.com/sbromberger/LightGraphs.jl into fasterdosrenyi fix rst newline use div instead of Int() to evaluate n choose 2 Merge branch 'fasterdosrenyi' of github.com:jpfairbanks/LightGraphs.jl into fasterdosrenyi
@jpfairbanks just thinking out loud - could we come up with a minimum value of |
If p_n in o(n_n) then you might as well use dense. I think that using the On Thu, Mar 26, 2015 at 8:56 PM Seth Bromberger notifications@github.com
|
I'm confused about this performance:
I would've thought that with a
|
I like to think of the sparsity in terms of the average degree that is We should still see where the extra memory usage is coming from. Is it all in the |
It's not so much the memory usage, but the comparative speed. Under what conditions will |
|
I'm not seeing it:
|
I am on v0.4 and I modified the sparse implementation to print out the rejection and acceptance numbers, how many time has_edge returned true.
As you can see from the fact that when p is small increases in p do not translate into increases in run time the time is dominated by the time to generate the n^2 random numbers. But once p gets large the run time is dominated by the time to insert the edges into the data structure and this causes the run time between sparse and dense to converge. |
There's a slight bug in the sparse implementation: you must also check that i != j (that is, that the source != the destination - we don't allow self-loops in Graphs.) I can fix that. I'm rethinking a "nocheck" option to |
I think the right way to do it is |
We already have that in the Graph constructor (check out |
Do you mean this? function Graph(nv::Integer, ne::Integer)
g = Graph(nv)
i = 1
while i <= ne
source = rand(1:nv)
dest = rand(1:nv)
e = (source, dest)
if (source != dest) && !(has_edge(g,source,dest))
i+= 1
add_edge!(g,source,dest)
end
end
return g
end This does not call |
Yes - it's not meant to be equal to |
(To be fair, I did mention this in #27 (comment) :) ) |
We have a matrix->graph function already. Check out |
Yea I should read better. Do you want to have performance benchmarks built into the repo? Should they go in test/perf/filename.jl |
That's a really interesting idea. How would they work given that folks are running on different hardware - or is the intent to run these prior to merging commits to ensure everything's good? (That sounds like a great idea, actually.) |
Well the first thing would be to just run them and have them write out the timing information to STDOUT. Using JSON is good because it has the flexibility to expand the schema as you add performance tests to run. Later we can write a script to process all the json and determine if there are performance regressions. |
@jpfairbanks I still really like this idea of building benchmarks into the repo. I'll start an issue to track it. |
Is this sufficiently squashed version of #29? I just concatenated the commit messages. If you want something else, send the git commands to make it happen.