[graph-tool] Re: ValueError: invalid edge descriptor. How to debug?

2021-09-03 Thread Gerion Entrup
Am Freitag, 3. September 2021, 11:12:45 CEST schrieb Tiago de Paula Peixoto:
> Am 03.09.21 um 00:18 schrieb Gerion Entrup:
> > 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.
> 
> What you should do is produce a minimal example that shows the 
> problem... No debugger is going to replace this simple strategy.

The function is not new. It has worked for some time now. I'm pretty sure, that 
this exact graph produces the problem.
So to make a minimal example, it would help to understand the problem first.


>  From the code fragment that you have shown, it's not possible to say much.
> 
> I notice that you are subclassing Graph, and probably omitting to us 
> specializations that you are making to Graph.vertex() and other methods.

There are no specializations of any graph-tool function in the subclass. It 
only exists to provide additional specialized functions.

Has the Python wrapper object that boost creates some special data fields that 
I could print? I'm compiling graph-tool on my own, anyway. Can I add some 
prints at the place in the graph-tool sourcecode where the "invalid edge 
descriptor" is generated?

Best
Gerion




signature.asc
Description: This is a digitally signed message part.
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de


[graph-tool] Stable topological sort in graph_tool

2021-09-03 Thread Sergey Mironov
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 [1] 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?

BR,
Sergey

[1] https://stackoverflow.com/questions/11230881/stable-topological-sort
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de


[graph-tool] Re: ValueError: invalid edge descriptor. How to debug?

2021-09-03 Thread Tiago de Paula Peixoto

Am 03.09.21 um 00:18 schrieb Gerion Entrup:

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.


What you should do is produce a minimal example that shows the 
problem... No debugger is going to replace this simple strategy.


From the code fragment that you have shown, it's not possible to say much.

I notice that you are subclassing Graph, and probably omitting to us 
specializations that you are making to Graph.vertex() and other methods.


--
Tiago de Paula Peixoto 
___
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-le...@skewed.de