Skip to content

Refactor the classic API PGraph to be a Python-only wrapper for the full API Graph class #64

Description

@john-boyer-phd

In the classic API, the PGraph class uses its own Cython bridge to call Edge Addition Planarity Suite (EAPS) functions like gp_New(), and its data member theGraph is a graphP.

The __init__() method creates a bridge from a NetworkX in-memory graph to an EAPS in-memory graph. But then only the classic API functions defined for the PGraph class can be called on the EAPS graph.

It would help if __init__() could instantiate a Graph class from the full API, rather than directly creating an EAPS graph. Then, all classic API functionality could invoke the methods of the full API Graph instance, and the separate Cython bridge for the classic API could be eliminated.

It would also be possible to add a function to PGraph that would allow a caller to gain access to the Graph that it wraps. Then, the PGraph functionality could be used to import a NetworkX graph into the PGraph's Graph instance, and the Graph instance accessor could enable the caller to perform any function of the full API on a graph that came from NetworkX.

As an example, NetworkX has a wide array of graph parsers, such as for GraphML. This work would allow EAPS functions to be performed on graphs read from GraphML files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions