installing on linux using conda-forge gives the following error
anaconda3/envs/gt/bin/gtk-query-immodules-3.0: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory
ERROR: Failed to complete gtk3's post-link script.
To fix this, activate the environment and run:
gtk-update-icon-cache -f -t "/home/anaconda3/envs/gt/share/icons/hicolor"
unfortunately running the three suggested lines gives another error
gtk-query-immodules-3.0: error while loading shared libraries: libXcursor.so.1: cannot open shared object file: No such file or directory
and running graph-tool also gives an error
I got a strange problem. I have this code (simplified, the Graph represented by graph_tool is a control flow graph):
def get_function_bbs(self, function):
for edge in self.vertex(function).out_edges():
if self.ep.type[edge] == CFType.f2b:
Calling the function `get_function_bbs` now leads to a `ValueError: invalid edge descriptor`. The stack trace says the `print(edge)` instruction is responsible for the error:
File "/.../graph.py", line 93, in get_function_bbs
ValueError: invalid edge descriptor
In my tests the function is called many times. This is the output (--- indicates a new call of get_function_bbs)
So: `71` is the vertex, where the functions fails. There are two edges `(71, 72)` and `(71, 73)` where the descriptor is valid and another unknown edge that is _not_ valid.
All edge descriptors have no dict.
My question: How can I debug this and find out, why it is invalid? Can I do/print anything in Python? Should I use GDB? Where would be a good place to set a breakpoint?
I cannot print the faulty edge. It is fairly complicate to make an minimal example. My whole code uses no remove_edge() or remove_vertex(). I'm using graph_tool 2.43.
Hi, list. Lets call a topological sort of a graph stable, if it preserves
some total ordering of nodes, if the topological order for these nodes is
not defined. The StackOverflow question  captures the problem, and the
pshufb's answer seems correct to me.
How would you implement such a sort using graph_tool, which AFAIK has only
an "unstable" version? Would it be possible to run 'topological_sort' on a
copied graph with additional edges in it?
Hi all, I have a NestedBlockState with LayeredBlockState as basis, two layers. I would like to predict edges that are missing in one or the other layer (besides, is this even possible?). However, given a list of missing edges (and a list of spurious ones) I tried this
and get this error
AttributeError Traceback (most recent call last)
<ipython-input-68-b3bc5280d3da> in <module>
----> 1 a_state.get_edges_prob([missing], spurious)
~/anaconda3/envs/experimental/lib/python3.8/site-packages/graph_tool/inference/nested_blockmodel.py in get_edges_prob(self, missing, spurious, entropy_args)
--> 443 L += lstate.get_edges_prob(missing, spurious, entropy_args=eargs)
444 if isinstance(self.levels, LayeredBlockState):
445 missing = [(lstate.b[u], lstate.b[v], l_) for u, v, l_ in missing]
~/anaconda3/envs/experimental/lib/python3.8/site-packages/graph_tool/inference/blockmodel.py in get_edges_prob(self, missing, spurious, entropy_args)
1204 pos[v] = self.b[v]
-> 1206 self.remove_vertex(pos.keys())
~/anaconda3/envs/experimental/lib/python3.8/site-packages/graph_tool/inference/blockmodel.py in remove_vertex(self, v)
-> 1146 self._state.remove_vertex(int(v))
1148 def add_vertex(self, v, r):
AttributeError: 'graph_tool::BlockState<boost::undirected_adaptor<b' object has no attribute 'remove_vertex'
I'm not sure what's happening here, but as far as I know gt.BlockState (and gt.NestedBlockState and gt.LayeredBlockState) have a remove_vertex method defined, right?
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
- 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:
k_in = in_degrees[a]
g=gt.random_graph(N, lambda:(sample_in(), sample_out()),
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.
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
- Is there a better way how to create representative small networks?
Any help on that issue will be much appreciated.
Sent from: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/