Graph generator with the given weighted edge sequence.

Hi,

I need a graph generator similar to the:

igraph_degree_sequence_game — Generates a random graph with a given degree sequence

But returns a random graph with the given weighted edge sequence. I have the weight of edges that enter and of edges that leave each node, and I need to generate random links.

Can I generate?

Thank you,

Alvaro

There is no such built-in function at the moment.

This does not seem like a trivial problem, and I can see multiple interpretations of what you describe. Can you clarify through a concrete example? Show a concrete example input, and a possible valid output from the function.


P.S. The reason why the system held your post for moderation is that it detected that it was pasted (not typed at a typical rate). Did you cross-post it to somewhere else? This is the typical reason why people end up copy/pasting. If you cross-posted, please link to the other instances of this post.

@szhorvat This is a question about moderation, not sample_degseq.
“P.S. The reason why the system held your post for moderation is that it detected that it was pasted (not typed at a typical rate). Did you cross-post it to somewhere else? This is the typical reason why people end up copy/pasting.”
Actually I typically edit in a text editor to avoid the frustration when a web page is inadvertently refreshed and one’s work is lost. So if I compose in a text editor and paste it will always be held for moderation?

I don’t know, but I don’t think so. We are still learning to use Discourse, and adapting as we go. This was a default setting. It is meant to prevent spam messages, so I assume it only applies to first-time posters. If you find any problems with this, do let me know.

The reason I commented on this (for the first time) is because there is a chance that @Alvaro_Sechinel has cross-posted the same question somewhere else. In the past, this auto-moderation action was triggered when people have written a message to the old igraph mailing list, then later posted it here as well. We don’t have a policy against cross-posting, but it is useful to cross-link cross-posts: if someone gives an answer on one forum only, people reading the question on a different forum should have a link to that answer.

Hi,

It is the first time that I post on the forum.

Input example:

1 out= 75.43 (sum of edges coming out of node A)
1 in = 77.18 (sum of edges entering node A)

2 out = 213.122
2 in = 73.805

3 out = 14.921
3 in = 28.564

4 out = 71.056
4 in = 210.864

5 out = 22.642
5 in = 111.778

6 out = 4.263
6 in = 0.897

7 out = 105.917
7 in = 4.263

Output example:

Grafo

In the output example:

A= 73.805
B= 68.120
C= 3.883
D= 209.239
E= 9.060
F= 21.745
G= 1.625
H= 2.936
I= 5.861
J= 0.897
K= 4.263
L=105.917

Thanks,

Alvaro

So you have no constraints on how many outgoing and incoming connections a vertex can have, or on which other vertices it may connect to. Your only constraints are on the total incoming and outgoing edge weights, for each vertex. Edge weights are non-negative real numbers.

I believe this is the matrix scaling problem. There’s an overview here:

Perhaps this is a useful starting point.

Hi,

Is there any way to use the generator igraph_degree_sequence_game with positive rational numbers in the arguments in_deg and out_deg?
My idea is to use igraph_degree_sequence_game generator with the sum of edges that enter the node in the argument in_deg and the sum of edges that exit the node in the argument out_deg. I think the output would be equivalent.

Thanks,

Alvaro

No, there is not. The methods used by this function construct unweighted graphs.

You can use the IGRAPH_DEGSEQ_SIMPLE method (i.e. the configuration model) with large positive integers to construct a multigraph, then interpret edge multiplicities as weights. However:

  • the sampling will not be uniform (see documentation)
  • there will be self-loops