Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Re: GraphComplement doesn't work in 7.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97128] Re: [mg97086] Re: [mg97063] GraphComplement doesn't work in 7.0
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Fri, 6 Mar 2009 04:23:16 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200903041212.HAA27227@smc.vnet.net> <200903050952.EAA29006@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

Conversion from the new type of "rule-list" graph structure to a 
Combinatorica Graph type structure is straightforward. Example:

   g = {1->4,2->4,3->4,1->2,2->3,1->3,1->1,1->3};
   newg = g/.{(v_->w_)->{v,w}}

   Needs["Combinatorica`"]
   FromOrderedPairs[newg]

(It may have been Carl Woll of WRI who suggested this.)

Murray Eisenberg wrote:
> The function GraphComplement IS implemented in the Combinatorica package 
> -- but only for the kinds of graph structures handled by Combinatorica.
> 
> For example:
> 
>    <<Combinatorica`
>    g=Hypercube[4];
>    ShowGraph[GraphComplement[g]]
> 
> This will create and show the complement of the hypercube.
> 
> The kind of graph you use, {1->2}, is a newer type of graph structure 
> that can be displayed by the new kernel function GraphPlot. But it is 
> not the native Combinatorica type of graph, and you would need to 
> convert your graph to the Combinatorica type structure first.
> 
> This is all an unfortunate result of a very incomplete integration so 
> far between the older Combinatorica package (where you use ShowGraph to 
> display a graph) and the newer kernel functionality where you use GraphPlot.
> 
> 
> Tangerine Luo wrote:
>> I find some functions do not work in mathematica 7.0. Why?
>> are some function not implemented yet?
>> << Combinatorica`
>> In[4]:= GraphComplement[{1 -> 2}]
>>
>> Out[4]= GraphComplement[{1 -> 2}]
>>
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Wolfram Workbench source editor and corrupted file
  • Next by Date: Re: Re: Conjecture: 2n+1= 2^i+p ; 6k-2 or 6k+2 = 3^i+p
  • Previous by thread: Re: GraphComplement doesn't work in 7.0
  • Next by thread: Re: GraphComplement doesn't work in 7.0