Ask Your Question

insidiae's profile - activity

2021-01-01 18:20:45 +0100 received badge  Nice Question (source)
2020-11-11 12:51:48 +0100 received badge  Editor (source)
2020-11-08 12:18:09 +0100 received badge  Student (source)
2020-11-06 20:22:02 +0100 asked a question FeatureNotPresentError: linking issue with CSDP

I'm trying to use the Lovász theta-function for graphs. When I attempt to use the function, I get the following error:

FeatureNotPresentError                    Traceback (most recent call last)
<ipython-input-9-3a9a00f477b1> in <module>
      1 g = graphs.CycleGraph(Integer(7))
----> 2 lovasz_bound(g, Integer(2))

<ipython-input-2-d57428a0d48f> in lovasz_bound(G, k)
     27 def lovasz_bound(G, k):
     28     H = power_graph(G, k)
---> 29     return H.lovasz_theta()

/usr/lib/python3/dist-packages/sage/graphs/ in lovasz_theta(graph)
     67     from sage.features.csdp import CSDP
---> 68     CSDP().require()
     70     g = graph.relabel(inplace=False, perm=range(1, n + 1)).networkx_graph()

/usr/lib/python3/dist-packages/sage/features/ in require(self)
    189         presence = self.is_present()
    190         if not presence:
--> 191             raise FeatureNotPresentError(self, presence.reason, presence.resolution)
    193     def __repr__(self):

FeatureNotPresentError: CSDP is not available.
Executable 'theta' not found on PATH.
To install CSDP you can try to run 'sage -i csdp'

It thus seems to be unable to find the CSDP package which it uses to compute the Lovász theta-function.

I'm running Ubuntu 20.04, and have installed SageMath 9.0 via the APT package manager. Therefore, I cannot use 'sage -i' to install packages. I have installed CSDP separately via the package manager as well (the 'coinor-csdp' package), but SageMath doesn't seem to pick it up. I can access CSDP from the command line just fine.

Is there a way to manually link the package? Or is it not possible to use such packages when installing from the APT repositories and should I install from SageMath's binaries?

Many thanks in advance.

Edit: I have decided to install the SageMath binaries directly, and everything now works perfectly.