Dear Tiago,
I have a directed graph of about half a million nodes and approximately a
million edges following scale free behaviour and a power law degree
distribution. To test some of my hypothesis, I would like to generate random
smaller graphs (about 50 up to 200 nodes) representative of the big one.
When I used a sample function that samples straight away from the real
distribution of the big network, I have following problems:
- I generate unconnected nodes with both 0 in AND out degree.
- I generate small sub parts of a few nodes that are not connected to the
main graph.
- If only sampling from nodes with at least 1 degree, the generated graph is
coherent, but not representative anymore as I need a big portion of nodes
with either only one in or one out degree.
Here is the part of my script I used for that, where samples are drawn from
dictionaries of the degrees:
def sample_in():
a=np.random.randint(num)
k_in = in_degrees[a]
return k_in
def sample_out():
if sample_in()==0:
b=np.random.randint(num_out)
k_out=out_zero_zeros.values()[b]
return k_out
else:
b=np.random.randint(num)
k_out=out_degrees[b]
return k_out
N=200
g=gt.random_graph(N, lambda:(sample_in(), sample_out()),
model="constrained-configuration", directed=True)
I also tried sampling from a list of tuples as you have mentioned before in
the forum, but I didn't receive any results, as the tuples randomly drawn
from my list might not be combinable.
degs=[(7,1),(4,3),(5,6),(2,4),(6,8),(2,0),(3,5),(0,3),(2,7),(2,1)]
g = gt.random_graph(4, lambda i: degs[i], directed=True)
- Is there any option I could active that would help me in those cases I
described above?
- Is there a better way how to create representative small networks?
Any help on that issue will be much appreciated.
Best wishes,
Jana
--
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/

Hi again,
I'm writing a small package that builds on graph-tool, but not on its graphics capabilities (also because I have to represent other things rather than the graph itself). Still I could use some of the functions "under the hood" for my purposes. I have a question about gt.draw.get_hierarchy_control_points(): the function returns the Bézier spline control points for edges in a given graph, but I'm having difficulties in understanding how this information is encoded. For a single edge in graph, I have dozens of values as control points (half dozens + 2), hence I suspect all splines going from node A to the root of a hierarchy and back to node B are encoded there, and control points should be taken 6 by 6 (3x2 by 3x2 coordinates?). How (x,y) for control points are encoded then: (x, x, x, y, y, y) or (x, y, x, y, x, y)? What are the 2 additiona values I have for each vector? Also, are values absolute or relative to one node in particular (A, B or root...)?
Thanks
d

I am curious what is being used to calculate the standard deviation of the
average in gt.vertex_average and gt.edge_average
>>> t2=gt.Graph()
>>> t2.add_vertex(2)
>>> t2.add_edge(t2.vertex(0), t2.vertex(1))
>>> gt.vertex_average(t2, "in")
(0.5, 0.35355339059327373)
Now, shouldn't std be σ(n)=sqrt(((0-0.5)^2+(1-0.5)^2)/2)=0.5 ?
also q(n-1)=sqrt((0.5^2+0.5^2)/(2-1))~=0.70710
0.3535 is sqrt(2)/4 which happens to be σ(n-1)/2, so it seems there is some
relation to that.
A little bigger graph.
>>> t3=gt.Graph()
>>> t3.add_vertex(5)
>>> t3.add_edge(t3.vertex(0), t3.vertex(1))
>>> gt.vertex_average(t3, "in")
(0.2, 0.17888543819998318)
Now, we should have 0,1,0,0,0 series for vertex incoming degree.
So Windows calc gives σ(n)=0.4 and σ(n-1)~=0.44721, so where does 0.1788854
come from ?
Reason, I am asking because, I have a large graph, where the average looks
quite alright but the std makes no sense, as going by the histogram, degree
values are quite a bit more distributed than the std would indicate.
--
View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com…
Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.

Hi everyone,
I am conducting tests where I perform several parallel tests of the
SIR model (they are not using n iterations because I need to find out
when the model stabilizes, where si (t) = 0).
Parallel execution has been carried out with the multiprocessing
library. In larger networks (2000 nodes), when performing the
procedure of removing parallel edges (the graphs are converted to
undirected), the execution freeze. Can you imagine the reason for this
behavior? If I don't execute the remove_parallel_edges function,
everything happens normally ...
Execution hangs when iterate_sync will be performed. A serial run
works normally (without multiprocessing).
Would anyone have a tip?
Best regards,
Ronaldo Alves

Hi, I followed the instructions in the official website
(https://git.skewed.de/count0/graph-tool/-/wikis/installation-instructions#d…)
to install graph-tool on ubuntu 16.04 LTS. I set DISTRIBUTION to xenial
(corresponding to ubuntu 16.04 LTS). Then I downloaded the public key as
instructed. However, when I ran apt-get update, it reported the error:
"The repository 'https://downloads.skewed.de/apt xenial Release' does not
have a Release file". The following line would not work, neither.
I wonder which DISTRIBUTION should I set? I tried the ones listed in the
website but failed when executing the "apt-get install
python3-graph-tool"...
Thank you very much for your time and I look forward to you reply.
--
Sent from: https://nabble.skewed.de/

Dear graph-tool community,
I have a little doubt off the topic.
I've been checking out the SIR model. In the mathematical expression
what is the meaning of the variable ri? Was it the likelihood of
spontaneous infection of the node? I checked the references, but I
still couldn't understand.
Can you help me?
Best regards,
Ronaldo Alves

Hi,
while trying to compile manually graph-tool on ubunto 20.04 by running
./configure, I'm getting this error message:
configure: error: Could not link against boost _iostreams
when checking the config.log file, it says:
/usr/bin/ld: cannot find -lboost_iostreams
How can I solve this?
Thanks!
--
Sent from: https://nabble.skewed.de/

Dear Tiago / Graph Tool community,
I am running the SBM on a directed network where edges are all conditional probability of one event, given the other, approximately 60 nodes.
This is generated originally from a binary matrix of repeated samples and if these 60 nodes as variables occurred or did not. However, in this binary matrix I have some missing data, which cannot be easily imputed, and I suspect is not missing at random.
I am keen to find a way to either control for this as a covariate, or alternatively show that the missingness of data does not cause a big issue in the SBM fit.
One possibility I have been exploring is by computing a conditional probability network of the missingness, and passing that as an additional edge covariate to the model.
So, in this instance I end up with two SBMs:
- 1 with a single edge weight, the conditional probability of the events occurring. The community structure of this is meaningful in its interpretation.
- 1 with two edge weights, the conditional probability of the events occurring, and also the conditional probability of the events being missing from the dataset (missingness matrix). The community structure of this is not as meaningful - largely events that are missing together will just cluster together. (For instance, I have several nodes representing given decades of life which will all just cluster together, as if being 20 is unknown then if they are 30 is also unknown.)
What is the best way to robustly compare the two SBM models and (hopefully) illustrate the model fit is better with the conditional probability of the event alone?
Alternatively, do you have any suggestions on how I would account for the missingness in the data when constructing the model?
Thank you for your time,
James

Hi tiago,
I was thinking if there is an efficient way to assing values to a vector
property map.
The only working method that I can use is the following:
vprop = g.new_vertex_property("vector<double>")
for i in range(G.num_vertices()):
vprop[G.vertex(i)] = [1,2,3]
When I try to use something like this:
index = np.where(some condition on vertex properties)[0]
vprop.a[index] = [1,2,3]
It gives me the error: "TypeError: 'NoneType' object does not support item
assignment".
The error comes only with vector< > type properties.
I am using this to assing colours to some vertices if a given condition is
satified.
I hope that you can help, because the first method is really slow on graphs
with hundred of thousands vertices.
--
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/