Hello,
I get a segmentation fault when trying to plot a loop with
graphviz_draw(). Here is a minimal example to reproduce the error:
import graph_tool.all as gt
g = gt.Graph()
v0 = g.add_vertex()
v1 = g.add_vertex()
e01 = g.add_edge(v0,v1)
e11 = g.add_edge(v1,v1) # loop
gt.graphviz_draw(g)
I have version 2.33 of python3-graph-tool installed on my computer which
runs on Linux Mint 19.2 Tina (based on Ubuntu 18.04 LTS, bionic). My
graphviz version is 2.40.1-2.
It works fine if I don't add the loop e11 to the graph.
It works fine if I use gt.graph_draw() instead of gt.graphviz_draw()
It works fine if I use graphviz directly (via a .dot file).
It did work fine in earlier versions of graph_tool.
Can anyone reproduce this?
Best regards
Rolf
--
-----------------------------------------------------------------------
Rolf Sander phone: [+49] 6131/305-4610
Max-Planck Institute of Chemistry email: rolf.sander(a)mpic.de
PO Box 3060, 55020 Mainz, Germany homepage: www.rolf-sander.net
-----------------------------------------------------------------------
https://www.encyclopedia-of-geosciences.nethttps://www.geoscientific-model-development.net
-----------------------------------------------------------------------
Hi all,
Using python graph_tool library. I see there is the pseudo_diameter method
but I was looking so something that can give me the exact diameter but
cannot seem to find.
Could anyone shine some light where this is (or why not included)?
Hi graphtool community!
In this period I am stuck in a timing problem.
I need to execute this function:
def *evolutionSIR*(G, ep_beta, count, v0):
state = SIRState(G, beta=ep_beta, gamma=gamma, v0=v0,
constant_beta=True)
s = state.get_state()
temp_state = np.zeros((count + 1, G.num_vertices()), dtype=int)
temp_state[0, :] = s.a[:]
for i in range(count):
state.iterate_sync()
s = state.get_state()
temp_state[i + 1, :] = s.a[:]
return temp_state
After this, I use a fuction to determine the timestep where each community
is infected.
My pc runs the *evolutionSIR* function in 1.1 s ± 48 ms, and the total time
to run the both functions is 1.16 s ± 48 ms. For my study I need to run
O(1E6) the two functions, and it takes a long time on my personal computer.
Reading the documentation, I noticed that *iterate_sync* has the *niter*
parameter and I tried it like this:
v0 = np.random.choice(G.get_vertices(), 1)
state = SIRState(G, beta=ep_beta, gamma=gamma, v0=v0, constant_beta=True)
state.iterate_sync(niter=count)
Doing this, it results to be almost 2.85 times faster (385 ms ± 39.3 ms)
than the *evolutionSIR* I wrote before but the problem is that I can't have
the states in each evolution step.
Is there a way to get the history of the diffusion using
*iterate_sync*(niter=count)?
Or is there a way to optimize the evolutionSIR function?
Greetings
--
Sent from: https://nabble.skewed.de/
Hello,
If I compare the implementation for the probability in the
graph/generation/graph_price.hh
which is (can be found in multiple places)
p = pow(Deg()(w, g) + c, gamma);
With what is written in the documentation
https://graph-tool.skewed.de/static/doc/generation.html#graph_tool.generati…
I wonder whether it should actually be (the constant outside the power) or
is the documentation wrong?
p = pow(Deg()(w, g), gamma) + c;
Greetings
Feelx234
--
Sent from: https://nabble.skewed.de/