Changes between Initial Version and Version 26 of Ticket #14535

06/09/13 15:41:14 (8 years ago)

I've updated the patch.

I also removed the mutability checks from some of the backends. The central user-facing point to implement them is in GenericGraph / GenericGraph_pyx. This is similar to the matrix code where we, for example, don't patch linbox to support (im)mutability.

It seems there is quite a bit of overhead in graph construction since the GenericGraph._backend is a Python class. This means various dictionary lookups to locate add_vertex and friends. You could shave off a lot of overhead by

  1. Move the construction methods (add_vertex etc) from GenericGraph to GenericGraph_pyx
  2. Switch GenericGraphBackend and its subclasses to Cython and make its methods cdef
  3. Equip GenericGraph_pyx with a Cython attribute cdef GenericGraphBackend _backend

See also But thats material for another ticket.

Once all the constructions methods are in GenericGraph_pyx it'll also be easy to switch the mutability check to a very fast inline function.


  • Ticket #14535

    • Property Status changed from new to needs_review
    • Property Cc jernej added
    • Property Authors changed from Simon King to Simon King, Volker Braun
  • Ticket #14535 – Description

    initial v26  
    55With this patch, the attempt to change an immutable graph be means of methods such as add_vertex or add_edge or delete_vertex, will result in an error. If one really wants to play nasty, one could make an immutable graph mutable and change it, or use the backend of the graph for changing the underlying data.
     7Apply [attachment:trac14535-immutable_graphs_vb.patch]