Home | Trees | Indices | Help |
---|
|
Version: $Revision: 1049 $
Date: $Date: 2005-06-17 08:06:22 -0600 (Fri, 17 Jun 2005) $
Author: Aric Hagberg (hagberg@lanl.gov) Pieter Swart (swart@lanl.gov) Dan Schult (dschult@colgate.edu)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__credits__ =
|
|
Returns True if the sequence is a threshold degree seqeunce. Uses the property that a threshold graph must be constructed by adding either dominating or isolated nodes. Thus, it can be deconstructed iteratively by removing a node of degree zero or a node that connects to the remaining nodes. If this deconstruction failes then the sequence is not a threshold sequence. |
Determines the creation sequence for the given threshold degree sequence. The creation sequence is a list of single characters 'd' or 'i': 'd' for dominating or 'i' for isolated vertices. Dominating vertices are connected to all vertices present when it is added. The first node added is by convention 'd'. This list can be converted to a string if desired using "".join(cs) If with_labels==True: Returns a list of 2-tuples containing the vertex number and a character 'd' or 'i' which describes the type of vertex. If compact==True: Returns the creation sequence in a compact form that is the number of 'i's and 'd's alternating. Examples: [1,2,2,3] represents d,i,i,d,d,i,i,i [3,1,2] represents d,d,d,i,d,d Notice that the first number is the first vertex to be used for construction and so is always 'd'. with_labels and compact cannot both be True. Returns None if the sequence is not a threshold sequence |
Returns the creation sequence in a compact form that is the number of 'i's and 'd's alternating. Examples: [1,2,2,3] represents d,i,i,d,d,i,i,i. [3,1,2] represents d,d,d,i,d,d. Notice that the first number is the first vertex to be used for construction and so is always 'd'. Labeled creation sequences lose their labels in the compact representation. |
|
|
Returns a creation sequence for a threshold graph determined by the weights and threshold given as input. If the sum of two node weights is greater than the threshold value, an edge is created between these nodes. The creation sequence is a list of single characters 'd' or 'i': 'd' for dominating or 'i' for isolated vertices. Dominating vertices are connected to all vertices present when it is added. The first node added is by convention 'd'. If with_labels==True: Returns a list of 2-tuples containing the vertex number and a character 'd' or 'i' which describes the type of vertex. If compact==True: Returns the creation sequence in a compact form that is the number of 'i's and 'd's alternating. Examples: [1,2,2,3] represents d,i,i,d,d,i,i,i [3,1,2] represents d,d,d,i,d,d Notice that the first number is the first vertex to be used for construction and so is always 'd'. with_labels and compact cannot both be True. |
Create a threshold graph from the creation sequence or compact creation_sequence. The input sequence can be a creation sequence (e.g. ['d','i','d','d','d','i']) labeled creation sequence (e.g. [(0,'d'),(2,'d'),(1,'i')]) compact creation sequence (e.g. [2,1,1,2,0]) Use cs=creation_sequence(degree_sequence,labeled=True) to convert a degree sequence to a creation sequence. Returns None if the sequence is not valid |
|
|
|
|
Find the shortest path between u and v in a threshold graph G with the given creation_sequence. For an unlabeled creation_sequence, the vertices u and v must be integers in (0,len(sequence)) refering to the position of the desired vertices in the sequence. For a labeled creation_sequence, u and v are labels of veritices. Use cs=creation_sequence(degree_sequence,with_labels=True) to convert a degree sequence to a creation sequence. Returns a list of vertices from u to v. Example: if they are neighbors, it returns [u,v] |
Return the shortest path length from indicated node to every other node for the threshold graph with the given creation sequence. Node is indicated by index i in creation_sequence unless creation_sequence is labeled in which case, i is taken to be the label of the node. Paths lengths in threshold graphs are at most 2. Length to unreachable nodes is set to -1. |
|
Return a 2-tuple of Laplacian eigenvalues and eigenvectors for the threshold network with creation_sequence. The first value is a list of eigenvalues. The second value is a list of eigenvectors. The lists are in the same order so corresponding eigenvectors and eigenvalues are in the same position in the two lists. Notice that the order of the eigenvalues returned by eigenvalues(cs) may not correspond to the order of these eigenvectors. |
Returns the coefficients of each eigenvector in a projection of the vector u onto the normalized eigenvectors which are contained in eigenpairs. eigenpairs should be a list of two objects. The first is a list of eigenvalues and the second a list of eigenvectors. The eigenvectors should be lists. There's not a lot of error checking on lengths of arrays, etc. so be careful. |
Return sequence of eigenvalues of the Laplacian of the threshold graph for the given creation_sequence. Based on the Ferrer's diagram method. The spectrum is integral and is the conjugate of the degree sequence. See: @Article{degree-merris-1994, author = {Russel Merris}, title = {Degree maximal graphs are Laplacian integral}, journal = {Linear Algebra Appl.}, year = {1994}, volume = {199}, pages = {381--389}, } |
Create a random threshold sequence of size n. A creation sequence is built by randomly choosing d's with probabiliy p and i's with probability 1-p. >>> s=random_threshold_sequence(10,0.5)
returns a threshold sequence of length 10 with equal probably of an i or a d at each position. A "random" threshold graph can be built with >>> G=threshold_graph(random_threshold_sequence(10,0.5))
|
Create a skewed threshold graph with a given number of vertices (n) and a given number of edges (m). The routine returns an unlabeled creation sequence for the threshold graph. FIXME: describe algorithm |
Create a skewed threshold graph with a given number of vertices (n) and a given number of edges (m). The routine returns an unlabeled creation sequence for the threshold graph. FIXME: describe algorithm |
Perform a "swap" operation on a threshold sequence. The swap preserves the number of nodes and edges in the graph for the given sequence. The resulting sequence is still a threshold sequence. Perform one split and one combine operation on the 'd's of a creation sequence for a threshold graph. This operation maintains the number of nodes and edges in the graph, but shifts the edges from node to node maintaining the threshold quality of the graph. |
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Sun Aug 17 12:04:45 2008 | http://epydoc.sourceforge.net |