New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphs with isolated vertices #559

merged 19 commits into from Mar 25, 2015


None yet
3 participants

nontas commented Feb 23, 2015

This PR does the following:

  • Changes all Graph and PointGraph definitions so that they take an (n_vertces, n_vertices, ) adjacency_matrix rather than an (n_edges, 2, ) adjacency_list. The adjacency_matrix is stored using scipy.sparse.csr_matrix.
  • All Graph and PointGraph subclasses also have an init_from_edges() method that has the old functionality, i.e. constructing an instance by passing in the adjacency_list (now renamed to edges).
  • Uses the functionality provided by scipy.sparse.csgraph. For example it replaces PADS minimum spanning tree with scipy.sparse.csgraph.minimum_spanning_tree.
  • It makes sure that PointUndirectedGraph and PointDirectedGraph (and of course UndirectedGraph and DirectedGraph support the definition of isolated vertices, i.e. vertices with no edge connections. This is not supported by PointTree (and Tree) as it doesn't make any sense.
  • Updates all docs. The biggest change is that PointGraph is now removed from the docs as it shouldn't be used directly; only its PointUndirectedGraph, PointDirectedGraph and PointTree subclasses are useful.

nontas added some commits Feb 19, 2015

@jabooth jabooth added the in progress label Feb 23, 2015

@nontas nontas referenced this pull request Feb 23, 2015


Shape notebooks #24


This comment has been minimized.


patricksnape commented Mar 9, 2015

I'm still seeing a guard for the lfpw_face landmarks that is preventing me from creating a graph with the isolated chin vertex.


This comment has been minimized.


nontas commented Mar 10, 2015

The problem pointed out by @patricksnape was my bad. I fixed it, so now it's possible to create a graph with a single vertex (thus no edges). Note that it is still not possible to create a graph without any vertices; an exception is raised.

Does anyone else have any comments about this PR? I'd like to merge it as soon as possible...


This comment has been minimized.


patricksnape commented Mar 10, 2015

This all looks great to me +1

@nontas nontas self-assigned this Mar 14, 2015


This comment has been minimized.


jabooth commented Mar 25, 2015

haven't had time to test this but looking through the code everything looks great, +1 from me

patricksnape added a commit that referenced this pull request Mar 25, 2015

Merge pull request #559 from nontas/graph_refactor
Graphs with isolated vertices

@patricksnape patricksnape merged commit 758283e into menpo:master Mar 25, 2015

1 of 3 checks passed

clahub One or more of this commit's parents has contributors who have not signed the Contributor License Agreement.
continuous-integration/appveyor AppVeyor build failed
continuous-integration/travis-ci/pr The Travis CI build passed

jabooth added a commit to jabooth/menpodetect that referenced this pull request Apr 12, 2015

@nontas nontas deleted the nontas:graph_refactor branch Apr 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment