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).