graphlab.Vertex

class graphlab.Vertex(self, vid, attr={})

A vertex object, consisting of a vertex ID and a dictionary of vertex attributes. The vertex ID can be an integer, string, or float.

Parameters:

vid : int or string or float

Vertex ID.

attr : dict, optional

Vertex attributes. A Dictionary of string keys and values with one of the following types: int, float, string, array of floats.

See also

Edge, SGraph

Examples

>>> from graphlab import SGraph, Vertex, Edge
>>> g = SGraph()
>>> verts = [Vertex(0, attr={'breed': 'labrador'}),
             Vertex(1, attr={'breed': 'labrador'}),
             Vertex(2, attr={'breed': 'vizsla'})]
>>> g = g.add_vertices(verts)

Methods

Attributes

Vertex.attr
Vertex.vid