Graph API

Note

This module is for abstraction. It needs to be overrided. See module yotsuba.lib.kotoba for example.

Data Structures for Mathematical Graph for Yotsuba 3

class yotsuba.core.graph.Graph

Data structure representing a graph.

append

L.append(object) – append object to end

count

L.count(value) -> integer – return number of occurrences of value

extend

L.extend(iterable) – extend list by appending elements from the iterable

get_edges_to_others()

Get the list of all vertices of the other graphs that connecting to this graph. (Make a connected-or-not-connected subgraph from it.)

index

L.index(value, [start, [stop]]) -> integer – return first index of value. Raises ValueError if the value is not present.

insert

L.insert(index, object) – insert object before index

static is_abstract_of(obj_ref)

Check if the object is an instance of this class.

pop

L.pop([index]) -> item – remove and return item at index (default last). Raises IndexError if list is empty or index is out of range.

remove

L.remove(value) – remove first occurrence of value. Raises ValueError if the value is not present.

reverse

L.reverse() – reverse IN PLACE

sort

L.sort(cmp=None, key=None, reverse=False) – stable sort IN PLACE; cmp(x, y) -> -1, 0, 1

class yotsuba.core.graph.Vertex(name, adjacents=None)

Data structure representing a vertex in a graph.

guid()

GUID of the vertex

init(name, adjacents=None)

Secondary constructor for lazy instantiation or resetting.

See the constructor for the usage.

static is_abstract_of(obj_ref)

Check if the object is an instance of this class.

is_connected_to(vertex)

Check if vertex (required, graph.Vertex-based object) is connected with this node.

make_edge_to(vertex)

Make an edge to the another vertex (required, graph.Vertex-based object).

Previous topic

Fuoco Multi-threading Programming Framework

Next topic

Kotoba XML Parser with Level-3 CSS Selector

This Page