Ask Your Question

vermette's profile - activity

2020-07-24 09:49:28 +0100 received badge  Famous Question (source)
2017-10-19 09:52:28 +0100 received badge  Student (source)
2017-02-18 15:35:48 +0100 received badge  Famous Question (source)
2015-07-03 15:26:31 +0100 received badge  Notable Question (source)
2015-06-20 13:34:16 +0100 received badge  Notable Question (source)
2014-01-14 21:51:52 +0100 received badge  Popular Question (source)
2013-10-13 14:41:28 +0100 received badge  Popular Question (source)
2013-05-08 15:37:33 +0100 commented answer error installing nauty package on mac osx 10.7

Installing Command Line Tools from XCode's Downloads preference pane (as advised in the link you provided) did the trick. I found a dozen places advising to install XCode, but none mentioned that I'd also need to go into the preferences and install anything else (namely, the Command Line Tools). Thanks for your quick and accurate response!

2013-05-08 15:35:18 +0100 marked best answer error installing nauty package on mac osx 10.7

You need a C compiler for this. What happens in the terminal when you do

which gcc

or

gcc -v

Thankfully, we just updated the installation from source documentation to mention how to get this on Mac.

2013-05-07 22:25:36 +0100 asked a question error installing nauty package on mac osx 10.7

I am attempting to install the nauty package for Sage on my Mac OSX 10.7.5. The Sage version is Sage-5.9-OSX-64bit-10.7-x86_64-Darwin-app.dmg. Everything seems to work fine in Sage.

However, upon running install_package('nauty'), I get an error. The full output is here, I think the relevant part is this:

checking build system type... i686-apple-darwin11.4.2

checking host system type... i686-apple-darwin11.4.2

checking for gcc... gcc

checking whether the C compiler works... no

configure: error: in

`/Applications/Sage-5.9-OSX-64bit-10.7.app/Contents/Resources/sage/spkg/\

build/nauty-25/src':

configure: error: C compiler cannot create executables

See 'config.log' for more details.

Error configuring nauty.

The config.log which it references is here. Any help would be much appreciated. Also, let me know if there is a more preferred place to host a text file in the future.

2013-04-18 13:20:39 +0100 received badge  Scholar (source)
2013-04-18 13:20:39 +0100 marked best answer generate all (not necessarily induced) subgraphs of a graph

You could try the following

E=Set(G.edges())
V=G.vertices()
for s in E.subsets():
    H=Graph()
    H.add_edges( s )
    #If you are interested only in spanning subgraphs you have to include this line
    H.add_vertices( V )
    if check( H ):
        graphs_you_want.append( H.graph6_string() )

One thing to keep in mind is that you might want to get the canonical label of H into the list of graphs you want (in case you are interested in non labelled subgraphs). This could help avoid duplicates (isomorphic graphs) in the list.

This does not guarantee it will be faster, it will take the same time (maybe more) as your first approach when G is the complete graph.

2013-04-17 11:53:53 +0100 received badge  Supporter (source)
2013-04-17 11:51:29 +0100 commented answer generate all (not necessarily induced) subgraphs of a graph

thanks, this is what I want. my graphs are relatively sparse, so I think it should be faster. I didn't know much about `.edges()` or `.add_edges()`, those are quite useful. to handle the isomorphic graphs, I added just before appending graphs which pass `check()` the following: `H_can=H.canonical_label()`, then `graphs_you_want.append( H_can.graph6_string() )` to append. after it runs, `list(set(graphs_you_want))` removes duplicates (and is fairly fast because the list is short). thanks again~

2013-04-16 16:56:12 +0100 asked a question generate all (not necessarily induced) subgraphs of a graph

I want to, given a Sage graph G, generate all subgraphs of G and check them for some property, and store in a list those which satisfy the propery. What I'm doing currently seems very inefficient:

graphs_i_want=[]
for g in graphs.nauty_geng(str(G.order())):
    if G.subgraph_search(g):
        if check(g):
            graphs_i_want.append(g.graph6_string())

check(g) checks that g satisfies the properties I want, and it's done. Actually the code above works completely - it gives a list of the graph6 strings for every subgraph of G. However, I think it's overkill to check through all graphs, and it's also pretty slow for graphs larger than 6 vertices or so. I need it to work for more, up to maybe 15.

An iterator would be fine. I just need to check each of the graphs for some property. The code could be something like this:

graphs_i_want=[]
for g in all_subsets_generator(G):
    if check(g):
        graphs_i_want.append(g.graph6_string())

where all_subsets_generator(G) iterates over all subsets of G.

Thanks for any advice. Let me know if more information is needed.