Hi All, 

I am new to Graph-tool and learning the basic operation on the Graph. The
below command confused me a lot. 

--------------------------------------------- 

Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux 
Type "help", "copyright", "credits" or "license" for more information. 

>>> from graph_tool.all import *                                                
>>>                                                                             
>>>                                                                             
>>>      
Failed to connect to Mir: Failed to connect to server socket: No such file
or directory 
Unable to init server: Could not connect: Connection refused 
Failed to connect to Mir: Failed to connect to server socket: No such file
or directory 
Unable to init server: Could not connect: Connection refused 
>>> G=Graph(directed=False)                                                     
>>>                                                                             
>>>                                                                             
>>>     
>>> G.add_vertex()                                                              
>>>                                                                             
>>>                                                                             
>>>      
<Vertex object with index '0' at 0x7f70714a00f0>
>>> G.add_vertex() 
<Vertex object with index '1' at 0x7f70714a0210>
>>> G.add_vertex() 
<Vertex object with index '2' at 0x7f70714a00f0>
>>> G.add_vertex() 
<Vertex object with index '3' at 0x7f70714a0210>
>>> G.add_vertex() 
<Vertex object with index '4' at 0x7f70714a00f0>
>>> G.add_vertex() 
<Vertex object with index '5' at 0x7f70714a0210>
>>> G.add_vertex() 
<Vertex object with index '6' at 0x7f70714a00f0>
>>> G.add_edge(1,2)                                                             
>>>                                                                             
>>>                                                                             
>>>     
<Edge object with source '1' and target '2' at 0x7f7085fca9d0>
>>> print(G) 
<Graph object, undirected, with 7 vertices and 1 edge at 0x7f70967c5400>
>>> G.clear_vertex(1)                                                           
>>>                                                                             
>>>                                                                             
>>>     
>>> print(G)                                                                    
>>>                                                                             
>>>                                                                             
>>>      
<Graph object, undirected, with 7 vertices and 1 edge at 0x7f70967c5400>
>>> G.clear_vertex(2)                                                           
>>>                                                                             
>>>                                                                             
>>>     
>>> print(G)                                                                    
>>>                                                                             
>>>                                                                             
>>>      
<Graph object, undirected, with 7 vertices and 1 edge at 0x7f70967c5400>

--------------------------------------------- 

I know the clear_vertex is to clear all edges related with the Vertex. But
after executing the clear_vertex, it seems that the Graph still contains 1
edge created before. Will I need to revise my code ? 

I post the same on the stackoverflow
https://stackoverflow.com/questions/45031315/the-basic-usage-in-the-graph-tool-how-to-delete-vertex-and-related-edges-in-the?noredirect=1#comment77045641_45031315

Thank you, 
Best Regards.



--
View this message in context: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/The-basic-usage-in-the-Graph-tool-how-to-delete-vertex-and-related-edges-in-the-Graph-tool-tp4027299.html
Sent from the Main discussion list for the graph-tool project mailing list 
archive at Nabble.com.
_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to