Hi all,
I am having some problems working with clabels.
Whenever I use mcmc algorithms with clabels the kernel dies (upon inspection, I found the error is 'segmentation fault (core dumped)').
I am not sure what I am doing wrong, so here’s a minimum working example:
g = gt.collection.data["lesmis"]
clabel = g.vp["clabel"] = g.new_vp("int")
for v in g.vertices():
clabel[v]=np.random.randint(3)
state = gt.NestedBlockState(g, state_args={'clabel':clabel,'pclabel':clabel})
for i in range(100):
state.multiflip_mcmc_sweep(niter=10)
If it helps, I’m getting the same problem with the following changes:
- use equilibrate instead of multiflip.
- use two labels instead of three.
- use minimize_nested_blockmodel_dl instead of NestedBlockState
- pass clabels dictionary as **args
Extra information:
- If I run the multifip MCMC fewer times (let’s say 10) sometimes it works, sometimes it doesn’t, so it seems that the error is somewhat stochastic.
- This happens on different machines, both with Linux and Mac
Is this a bug or am I doing something wrong?
Best,
Valerio
---------------------------------------------------------------------
Lecturer in Business Applications of Informatics
Room 2.18a - Informatics Forum
School of Informatics - University of Edinburgh
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.

Hi,
I am currently filtering a graph. Sometimes hiding the vertices splits the original graph into separate components. Is there an elegant solution to avoid this? Essentially I would like to contract all paths through a component of hidden vertices into a single edge. I have found a solution that works, but it is incredibly slow:
1. Creating a GraphView with only the hidden vertices and label the components in this GraphView
2. For each of the hidden components loop over all vertices in the component and look for vertices that have a different in-degree or out-degree in the hidden GraphView and the original unfiltered graph
3. For each vertex 'I' with a different in-degree label the out-component and check which vertex 'O' with a different out-degree is part of the out-component of 'I'
4. Create an edge between all the in-neighbors of 'I' and all out-neighbors of 'O'
The result is correct, all the vertices that are connected by a path through these hidden components are now connected by a single edge in the filtered graph, but the process is painfully slow on graphs with 600k-5M vertices.

Dear all,
I am analyzing a multigraph and I would like to fetch all the edges
between given two vertices during runtime. I haven't been able to figure
out an easy way to do this. For now, there are two possible ways:
1. Iterate over all the edges and catch the ones which connect vertices
u and v
2. Go through all the neighbours of u and find out all the occurrences of v
Both these operations, especially the first one, is expensive. Also,
`g.edge(u,v)` seems to return only one edge without any information
about which one it is. How can I solve this problem?
Best regards,
SMS
--
Snehal M. Shekatkar
https://inferred.in
PGP key -> https://inferred.in/snehal_pub_key.txt

Hi all,
I was wondering if there is a simple way to save gt.interactive_window to html for interactive visualisation across web browsers? i.e. similar to implemented with plotly, and so on.
I have seen that gravis looks like an excellent alternative package to generate this otherwise, but wanted to first check if I was missing something within graph-tool to simply export the interactive_window.
#contained example
import graph_tool.all as gt
import matplotlib
g = gt.collection.ns["new_guinea_tribes"]
state = gt.minimize_nested_blockmodel_dl(g,
state_args=dict(base_type=gt.LayeredBlockState,
state_args=dict(ec=g.ep.weight, layers=True)))
levels=state.get_levels()
l0blocks=levels[0].get_blocks()
t = gt.get_hierarchy_tree(state)[0]
tpos = pos = gt.radial_tree_layout(t, t.vertex(t.num_vertices() - 1), weighted=True)
cts = gt.get_hierarchy_control_points(g, t, tpos)
pos = g.own_property(tpos)
#want to export this to HTML
gt.interactive_window(g,pos=pos,edge_control_points=cts,
edge_color=g.ep.weight, edge_gradient=[],
vertex_fill_color=gt.prop_to_size(l0blocks),
ecmap=(matplotlib.cm.coolwarm_r, .6), edge_pen_width=5,
sync=True,update_layout=False,geometry=(2000,2000),
vertex_text_color=[1,1,1,1],bg_color=[0,0,0,1]
)
Many thanks,
James

Hi everyone,
I was wondering if it would be possible to provide some more examples of
how to run a nested mixed membership SBM with edge weights. The new version
seems to have removed the "overlap=True" option for state_args in the
minimize_* functions.
Is this the correct way to do it now?
import graph_tool as gta
> import numpy as np
> g = .... # build graph
> e_score = .... #Set edge weights
> state_args = dict(
> deg_corr=deg_corr,
> base_type=gta.inference.overlap_blockmodel.OverlapBlockState,
> B=2*g.num_edges(), #B_max
> deg_corr=True,
> recs=[e_score],
> rec_types=["real-normal"])
> state = gta.inference.minimize_nested_blockmodel_dl(
> g,
> state_args=state_args,
> multilevel_mcmc_args=dict(verbose=True))
> # improve solution with merge-split
> state = state.copy(bs=state.get_bs() + [np.zeros(1)] * 4, sampling=True)
for i in range(100):
> if i%10==0: print(".", end="")
> ret = state.multiflip_mcmc_sweep(niter=10, beta=np.inf, verbose=True)
I am currently running this for a fully connected bipartite graph with 3454
nodes and 55008 edges. I understand it would take longer than the
non-overlapping version, but do you have any suggestions on how to speed it
up? The non-overlapping version takes about 15 minutes, while the
overlapping version is still running after 1 day.
Thanks for your help,
Eli
--
PhD Candidate, Phil Bourne's lab
University of Virginia
_______________________________________________
graph-tool mailing list -- graph-tool(a)skewed.de
To unsubscribe send an email to graph-tool-leave(a)skewed.de