Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Path after deletion of vertex

The following code

g = graphs.PathGraph(15)
g.delete_vertex(6)
g

prints "Path Graph: Graph on 14 vertices", but it's not a path after I delete vertex 6. It's the disjoint union of 2 paths. Same thing occurs with cycle (except it says Cycle Graph), same thing occurs if you delete an edge from either. Happens with complete graph if you delete an edge and make it no longer complete... so probably happens with any such named graph under edge or vertex deletions. Or, if you end with "Print g" instead of just "g", it says just "Complete Graph".

Path after deletion of vertex

The following code

g = graphs.PathGraph(15)
g.delete_vertex(6)
g

prints "Path prints

Path Graph: Graph on 14 vertices", vertices

but it's not a path after I delete vertex 6. It's the disjoint union of 2 paths. Same thing occurs with cycle (except it says Cycle Graph), same thing occurs if you delete an edge from either. Happens with complete graph if you delete an edge and make it no longer complete... so probably happens with any such named graph under edge or vertex deletions. Or, if you end with "Print g" instead of just "g", it says just "Complete Graph".