Ask Your Question

Ashwin Ganesan's profile - activity

2019-06-11 10:54:34 +0100 asked a question fractional chromatic index of edge-weighted graphs

How would you compute the fractional chromatic index of an edge-weighted graph using SAGE?

The built-in function fractional_chromatic_index seems to compute the fractional chromatic index for only unweighted graphs. For instance, if $G$ is the 5-cycle graph, its fractional chromatic index is $2.5$. But if one of the edges can be ignored, say by giving it a zero weight, then the fractional chromatic index becomes $2$.

The code and output below shows that SAGE ignores the edge-weights (notice that the edge-weights need not be integral - in the graph below, the correct value of the fractional chromatic index is 2.1, which is the maximum sum $1.1+1.0$ of weights of edges incident to a vertex):

sage: G = graphs.EmptyGraph()
sage: G.add_edges([(1,2,1.1),(2,3,1),(3,4,1),(4,5,1),(5,1,0)])
sage: G.fractional_chromatic_index()
5/2
sage:

Is there some way to get the built-in function to take edge weights into account? Or can this value be computed using some other method?

2015-01-01 06:01:58 +0100 received badge  Editor (source)
2014-12-31 11:59:27 +0100 asked a question permission settings in SAGE installation in ubuntu

My sage installation doesn't seem to work properly on a couple issues and I believe these are related to file permissions. Let me be specific. I downloaded the SAGE .tar.lzma file and installed it in the /opt directory (in Ubuntu 14). The first problem is that to launch sage, I need to type "sudo sage" because typing "sage" alone at the terminal gives the following error message:

~ > sage ┌────────────────────────────────────────────────────────────────────┐ │ Sage Version 6.4.1, Release Date: 2014-11-23 │ │ Type "notebook()" for the browser-based notebook interface.
│ │ Type "help()" for help.
│ └────────────────────────────────────────────────────────────────────┘ /opt/sage-6.4.1-x86_64-Linux/local/lib/python2.7/site-packages/IPython/utils/path.py:317: UserWarning: IPython parent '/home/ashwin/.sage' is not a writable location, using a temp directory. " using a temp directory."%parent)


Oops, Sage crashed. We do our best to make it stable, but... <snip> OSError: [Errno 13] Permission denied: '/home/ashwin/.sage/db'


So I type "sudo sage" and get into the sage prompt. At this point, the "load filename.sage" command doesn't work (this is the second problem with the installation). For example, loading a simple file test1.sage (which just does "x=3; print x+1") gives the following error message:

sage: load test1.sage File "<ipython-input-8-35dd081ddd0e>", line 1 load test1.sage ^ SyntaxError: invalid syntax

sage:

At another time, I got the response the load command was not found:

load myfunctions.sage No command 'load' found, did you mean: Command 'nload' from package 'nload' (universe) Command 'xload' from package 'x11-apps' (main) Command 'tload' from package 'procps' (main) load: command not found

I think the permissions on some of the files need to be changed from root to my username. I didn't have this problem earlier when I used the previous version of SAGE with Ubuntu 12, and I'm wondering if I did something wrong in the installation process.