teradata-aster-field / toaster

Tools for Aster in R
11 stars 2 forks source link

Always select from vertices table when constructing a graph with `computeGraph` #46

Closed grigory93 closed 8 years ago

grigory93 commented 8 years ago

Currently, the vertex table is not accessed when neither vertex attributes nor vertex where conditions are specified. This creates problems when auto-assigning ids (from 1 to vertex count) to vertices in a graph.

If we change computeGraph to always select vertices and order them by their names then id-ing vertices becomes consistent across all graph operations. In particular, this helps with clustering graphs and complying with standard community class objects (package igraph) when assigning vertex membership (and its membership element).

35 is related to this.

grigory93 commented 8 years ago

This is actually a bug: not selecting vertices by relying on edge table only won't incude vertices with degree 0.

grigory93 commented 8 years ago

all changes committed are in computeGraph.R