I need to extend the Networkx python package and add a few methods to the Graph
class for my particular need
The way I thought about doing this is simplying deriving a new class say NewGraph
, and adding the required methods.
However there are several other functions in networkx which create and return Graph
objects (e.g. generate a random graph). I now need to turn these Graph
objects into NewGraph
objects so that I can use my new methods.
What is the best way of doing this? Or should I be tackling the problem in a completely different manner?