getEdgeIndex -- finds the index of an edge in a HyperGraph

Synopsis

• Usage:
n = getEdgeIndex(H,E)
n = getEdgeIndex(H,M)
• Inputs:
• H, ,
• E, a list, of vertices
• M, , a monomial that is the product of vertices
• Outputs:
• n, an integer, the index of E as an edge of H. If E is not in H, then -1 is returned.

Description

This function returns the index of the edge of the (hyper)graph, where the ordering is determined by the internal ordering of the edges. Note that the internal order of the edges may not be preserved by methods that change the hypergraph (i.e., inducedHyperGraph, changeRing, hyperGraph(MonomialIdeal), etc.).

 i1 : S = QQ[z_1..z_8]; i2 : h = hyperGraph {z_2*z_3*z_4,z_6*z_8,z_7*z_5,z_1*z_6*z_7,z_2*z_4*z_8} o2 = HyperGraph{edges => {{z , z , z }, {z , z }, {z , z , z }, {z , z , z }, {z , z }}} 2 3 4 5 7 1 6 7 2 4 8 6 8 ring => S vertices => {z , z , z , z , z , z , z , z } 1 2 3 4 5 6 7 8 o2 : HyperGraph i3 : edges h o3 = {{z , z , z }, {z , z }, {z , z , z }, {z , z , z }, {z , z }} 2 3 4 5 7 1 6 7 2 4 8 6 8 o3 : List i4 : getEdgeIndex (h,{z_2,z_4,z_8}) -- although entered last, edge is internally stored in 4th spot (counting begins at 0) o4 = 3 i5 : getEdge(h,3) o5 = {z , z , z } 2 4 8 o5 : List i6 : getEdgeIndex (h,{z_1,z_2}) -- not in the edge list o6 = -1