all this works for me just fine: sage: g=Graph([[0,1],[2,3]]) sage: g.lovasz_theta() 2.0 sage: G = graphs.CycleGraph(7) sage: V = Set(G.vertices()) sage: L = [] sage: for s in V.subsets(): ....: L.append(G.subgraph(s)) ....: sage: L[68].lovasz_theta() 2.0
Can you try the following: sage: g=Graph([[0,1],[2,3]]) sage: g.lovasz_theta() On Tuesday, May 10, 2016 at 2:32:04 PM UTC+1, Sihuang Hu wrote: > > The adjacency matrix of the graph is > > [0 1 0 0] > [1 0 0 0] > [0 0 0 1] > [0 0 1 0] > > > 在 2016年5月10日星期二 UTC+3下午4:30:06,Dima Pasechnik写道: >> >> What is your L[68] ? >> This is probably something like a graph without edges... >> >> On Tuesday, May 10, 2016 at 1:53:17 PM UTC+1, Sihuang Hu wrote: >>> >>> Thanks for the comments. >>> I have installed package 'csdp' before. I got this error after I >>> installed it. >>> >>> 在 2016年5月10日星期二 UTC+3下午3:32:59,vdelecroix写道: >>>> >>>> The error you get is quite strange. On my computer with sage-7.1 I got >>>> >>>> sage: graphs.CycleGraph(7).lovasz_theta() >>>> Traceback (most recent call last): ur ... >>>> PackageNotFoundError: the package 'csdp' was not found. You can install >>>> it by running 'sage -i csdp' in a shell >>>> >>>> Which is very explicit about what to do... could you install the csdp >>>> package and try again? >>>> >>>> On 10/05/16 06:58, Sihuang Hu wrote: >>>> > Hi guys, >>>> > >>>> > When I try to compute the lovasz theta number of some graph, it says >>>> that >>>> > >>>> > *ValueError: could not convert string to float: failed.:*G = >>>> > graphs.CycleGraph(7) >>>> > V = Set(G.vertices()) >>>> > L = [] >>>> > for s in V.subsets(): >>>> > L.append(G.subgraph(s)) >>>> > >>>> > L[68].lovasz_theta() >>>> > >>>> --------------------------------------------------------------------------- >>>> >>>> > ValueError Traceback (most recent call >>>> last) >>>> > <ipython-input-53-0ad2fb49c2b1> in <module>() >>>> > ----> 1 L[Integer(68)].lovasz_theta() >>>> > >>>> > >>>> /home/shhu/Documents/SageMath/local/lib/python2.7/site-packages/sage/graphs/lovasz_theta.pyc >>>> >>>> >>>> > in lovasz_theta(graph) >>>> > 78 tf.close() >>>> > 79 lines = >>>> subprocess.check_output([os.path.join(SAGE_LOCAL, >>>> > 'bin', 'theta'), tf_name]) >>>> > ---> 80 return float(lines.split()[-1]) >>>> > >>>> > ValueError: could not convert string to float: failed. >>>> > >>>> > Thanks in advance! >>>> > >>>> >>> -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.