Add how-to for checking if one graph is a subgraph of another.

Done. It should be ready to go.



 <http://www.graphlab.com>   Brian Kent
Data Scientist
brian@graphlab.com





On Thu, Nov 20, 2014 at 12:08 PM, Srikrishna Sridhar <
notifications@github.com> wrote:

> In subgraph.py:
>
> > +import graphlab as gl
> > +
> > +def is_subgraph(subgraph, g, vert_id='__id', src_id='__src_id',
> > +                dst_id='__dst_id'):
> > +    """
> > +    Check if `sub_g` is a subgraph of `g`. `vert_id`, `src_id`, and
> > +    `dst_id` are the column names for vertex, source, and destination vertex
> > +    IDs.
> > +    """
> > +
> > +    subgraph_flag = True
> > +
> > +    ## Check if vertices are a subset
> > +    sf_filter = g.vertices.filter_by(subgraph.vertices[vert_id], vert_id)
> > +    if sf_filter.num_rows() < subgraph.vertices.num_rows():
> > +        subgraph_flag = False
>
> Add an example in the comments and it is good to go otherwise.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/graphlab-code/how-to/pull/16/files#r20673591>.
>