Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

defining function for graph (help needed)

I need help defining a function that does the following (I'm very new to python/sage).

I need a function called ihara(G) where G is any graph input by the user.

i need the function ihara(G) = Z after all the calculations below:

D = G.to_directed()
L = G.line_graph()
IM = identity_matrix(QQ,D.size())

T = L.adjaency.matrix()
L.delete_edges([((x,y,None), (y,x,None)) for x,y in G.edges( labels=None ) ])
L.delete_edges([((x,y,None), (y,x,None)) for y,x in G.edges( labels=None ) ])

var('u')

X=IM-u*T

Z=X.det()

Could anybody help me with this? or at least get me started in the right direction...

defining function for graph (help needed)

I need help defining a function that does the following (I'm very new to python/sage).

I need a function called ihara(G) where G is any graph input by the user.

i need the function ihara(G) = Z after all the calculations below:

D = G.to_directed()
L = G.line_graph()
IM = identity_matrix(QQ,D.size())

T = L.adjaency.matrix() D.line_graph()
L.delete_edges([((x,y,None), (y,x,None)) for x,y in G.edges( labels=None ) ])
L.delete_edges([((x,y,None), (y,x,None)) for y,x in G.edges( labels=None ) ])

IM = identity_matrix(QQ,D.size())

T = L.adjaency.matrix()

var('u')

X=IM-u*T

Z=X.det()

Could anybody help me with this? or at least get me started in the right direction...

defining function for graph (help needed)

I need help defining a function that does the following (I'm very new to python/sage). Python/Sage).

I need a function called ihara(G) where G is any graph input by the user.

i I need the function ihara(G) = to return the Z after resulting from all the calculations below:

D = G.to_directed() 
G.to_directed() L = D.line_graph()
D.line_graph() L.delete_edges([((x,y,None), (y,x,None)) for x,y in G.edges( labels=None ) ])
labels=None)]) L.delete_edges([((x,y,None), (y,x,None)) for y,x in G.edges( labels=None ) ])

labels=None)]) IM = identity_matrix(QQ,D.size()) T = L.adjacency.matrix() var('u') X = IM-u*T Z = X.det()

IM = identity_matrix(QQ,D.size())

T = L.adjaency.matrix()

var('u')

X=IM-u*T

Z=X.det()

Could anybody help me with this? or at least get me started in the right direction...