Rank: 6704 based on 10 downloads (last 30 days) and 1 file submitted
photo

golan pundak

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by golan pundak
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Dec 2010 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak graphs, combinatorics, mathematics, random 10 7
  • 3.5
3.5 | 3 ratings
Comments and Ratings by golan pundak View all
Updated File Comments Rating
31 Jul 2013 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak

Poormina: This code does (should) produce single undirected edge between nodes.
As a note: If you don't care about multiple edges and self loops there is a much simpler algorithm: pick d/2 permutations at random.
The reason this code is complicated is because it avoids multiple edges and self loops.

29 Jul 2013 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak

Poormina:

You can add weights by multiplying the output with a random matrix
A_W = A.*rand(size(A,1), size(A,2))

Not sure what do you mean by 'one edge'. If you want to edges to be directed the nice property of d-regularity will be lost.

12 Feb 2012 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak

So it seems these are all problems of dynamically allocating memory and coping data. Here are 2 optimizations that can solve this:
1. Replace the sparse n*n matrix A by a preallocated n*d adjacency list, filled initially with -1.

2. Instead of recreating U (half edges), keep its size as a separate variable and only swap elements when updating it.

Maybe I'll get to it some day :)

Comments and Ratings on golan pundak's Files View all
Updated File Comment by Comments Rating
31 Jul 2013 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak golan pundak

Poormina: This code does (should) produce single undirected edge between nodes.
As a note: If you don't care about multiple edges and self loops there is a much simpler algorithm: pick d/2 permutations at random.
The reason this code is complicated is because it avoids multiple edges and self loops.

31 Jul 2013 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak Poornima

Dear Golan
Thank you. That was really a valuable suggestion! :)
Well, When I meant 'one edge', I meant undirected edges.... or a single edge bw nodes.

29 Jul 2013 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak golan pundak

Poormina:

You can add weights by multiplying the output with a random matrix
A_W = A.*rand(size(A,1), size(A,2))

Not sure what do you mean by 'one edge'. If you want to edges to be directed the nice property of d-regularity will be lost.

29 Jul 2013 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak Poornima

A very nice script. Thank you.

Is it possible to display the graph with just one edge between the nodes and not two with this code? Also, is it possible add weights to the edges? Thanks in advance...

h = view(biograph(G,[],'ShowArrows','Off','ShowWeights','on'));

26 Apr 2012 Random Regular generator creates a random regular graph in the pairing model Author: golan pundak Felix Goldberg

Overall, very nice.
But I'm afraid a bug may be lurking somewhere. Sometimes I call this function and get a zero matrix. Is this a bug or a feature?

Contact us