Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: In Version 8, Combinatorial&GraphTheory functions confuse me completely

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120632] Re: In Version 8, Combinatorial&GraphTheory functions confuse me completely
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Sun, 31 Jul 2011 23:35:41 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201107311126.HAA05207@smc.vnet.net>

Which functionality from the Combinatorica package are you missing? I 
don't know if you have
read the entry Compatibility/tutorial/Combinatorica in the Document 
Center in Mathematica, but it explains
how you can achieve some of the functionality of the Combinatorica 
package with the new built in symbols.

Essentially, you can still load and use the package as before; the 
message is just a warning that some of the
symbols in the loaded package may clash with the built-in symbols. After 
loading the package, the symbols in
the Combinatorica package will shadow the built-in symbols meaning that 
if you call for example Graph, Mathematica
will use the one in the Combinatorica package, instead of the built-in 
one. Luckily, both symbols exist in their own
context, so you can distinguish between them by calling them with their 
full Context name. For example

System`Graph[{1 -> 2}]

will call the built in function Graph, and

Combinatorica`Graph[{{{1, 2}}}, {{{0, 0}}, {{1, 0}}}]

the function Graph defined in the Combinatorica package (provided the 
package is loaded). So for the second part of your
post, you could do something like

g = System`Graph[Table[i \[UndirectedEdge] Mod[i + 1, 2], {i, 20}]]


Heike.

On 31 Jul 2011, at 12:26, a boy wrote:

> 1. Mathematica8 says Combinatorica Graph and Permutations
> functionality has been superseded by preloaded functionaliy. But "
> preloaded functionaliy" seems to be not completed yet. There are only
> a few "preloaded functionaliy". At now, how to use Combinatorica &
> GraphUtilities package?
>
> << Combinatorica`
> Needs["GraphUtilities`"]
> ModMatrix[n_, list_] :=
> Table[If[MemberQ[list, Mod[j - i, n]], 1, 0], {i, 1, n}, {j, 1, n}]
> QuadraticModMatrix[n1_, list1_, n2_, list2_] :=
> ModMatrix[n1, list1] + ArrayPad[ModMatrix[n2, list2], {0, n1 - n2}]
>
> General::compat: Combinatorica Graph and Permutations functionality
> has been superseded by preloaded functionaliy. The package now being
> loaded may conflict with this. Please see the Compatibility Guide for
> details.
>
> 2. Both GraphPlot[g] and ShowGraph[g] doesn't work! How to plot these
> Graphs as below?
>
> In[71]:= n = 1;
> While[n++ < 10,
>  g = Graph[Table[i \[UndirectedEdge] Mod[i + 1, 2], {i, 20}]]
>  ];
> g
>





  • Prev by Date: Local scoping of pattern names in rules--or not
  • Next by Date: Re: Doesn't work in Mathematica 8
  • Previous by thread: In Version 8, Combinatorial&GraphTheory functions confuse me completely
  • Next by thread: Performance under Lion