| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
tuple --+
|
TriadCensus
Triad census of a graph.
This is a pretty simple class - basically it is a tuple, but it allows the user to refer to its individual items by the following triad names:003 -- the empty graph
012 -- a graph with a single directed edge (A
--> B, C)
102 -- a graph with a single mutual edge (A
<-> B, C)
021D -- the binary out-tree (A <-- B -->
C)
021U -- the binary in-tree (A --> B <--
C)
021C -- the directed line (A --> B -->
C)
111D -- A <-> B <-- C
111U -- A <-> B --> C
030T -- A --> B <-- C, A -->
C
030C -- A <-- B <-- C, A -->
C
201 -- A <-> B <-> C
120D -- A <-- B --> C, A <->
C
120U -- A --> B <-- C, A <->
C
120C -- A --> B --> C, A <->
C
210C -- A --> B <-> C, A <->
C
300 -- the complete graph (A <-> B
<-> C, A <-> C)
Attribute and item accessors are provided. Due to the syntax of
Python, attribute names are not allowed to start with a number, therefore
the triad names must be prepended with a lowercase t when
accessing them as attributes. This is not necessary with the item
accessor syntax.
>>> g=Graph.Erdos_Renyi(100, 0.2, directed=True) >>> tc=g.triad_census() >>> print tc.t003 39864 >>> print tc["030C"] 1206
|
|||
| __getattr__(self, attr) | ||
|
__getitem__(self,
idx) x[y] |
||
|
__repr__(self) repr(x) |
||
|
__str__(self) str(x) |
||
|
Inherited from Inherited from |
|||
|
|||
|
_remap = {'201': 10, '021C': 5, '021D': 3, '210': 14, '120U':...
|
||
|
|||
|
Inherited from |
|||
|
|||
|
|
|
|
|
|||
_remapNone
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0alpha3 on Thu Feb 14 12:44:01 2008 | http://epydoc.sourceforge.net |