Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: new Graph function + combinatorica: various problems
Replies: 8   Last Post: May 5, 2012 4:12 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
sjoerd.c.devries@gmail.com

Posts: 893
Registered: 10/6/08
Re: new Graph function + combinatorica: various problems
Posted: Feb 12, 2011 5:19 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I posted on graph conversion a couple of weeks ago.

Shading of Graph can be prevented by prepending the System` context
(System`Graph[...]).

The two versions of conversion yield different plots in GraphPlot.
Also my conversion route both yield minimum and maximum spanning trees
(although for the graphs I tested them, they look identical). The
ToCombinatoricaGraph conversion yields graphs for which (for all
graphs I tested) the minimum spanning tree does not plot.

Clearly, there is room for improvement in the graph area.

<< Combinatorica`
<< GraphUtilities`

myM8Graph = GraphData["ZamfirescuGraph48"]

(* conversion 1 *)
myCombinatoricaGraph =
FromAdjacencyMatrix[Normal[System`AdjacencyMatrix[myM8Graph]]];

myCombinatoricaGraph // ShowGraph
MinimumSpanningTree[myCombinatoricaGraph] // ShowGraph
MaximumSpanningTree[myCombinatoricaGraph] // ShowGraph

(* conversion 2*)
myCombinatoricaGraph = ToCombinatoricaGraph[myM8Graph];

myCombinatoricaGraph // ShowGraph
MinimumSpanningTree[myCombinatoricaGraph] // ShowGraph
MaximumSpanningTree[myCombinatoricaGraph] // ShowGraph

Cheers -- Sjoerd

On Feb 11, 10:20 am, Cupidio <andreatacche...@gmail.com> wrote:
> Hi,
> I'm experiencing some problems in combining the functionalities of
> combinatorica and the built-in functions for graphs.
>
> In fact loading combinatorica shadows the built-in Graph function, and
> makes its use impossible. But while I need some of the functions in
> the combinatorica package (minimum/maximum spanning tree), i prefer
> the graphic and "lexical" representation of the built-in Graph[].
>
> How do I "save" Graph[] when I load combinatorica, or how can I make
> it come back?
>
> Also (and this looks weird!), when i use ToCombinatoricaGraph[] (in
> GraphUtilites package) to convert a graph, the resulting object can be
> processed by MaximumSpanningTree[], yielding a correct result, but not
> by MinimumSpanningTree[] which returns something like:
>
> MinimumSpanningTree[-Graph:<14,8,Directed>-]
>
> ...not even a combinatorica graph object.
>
> Thanks for your help!






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.