MathGroup Archive 2010

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

Search the Archive

Re: Convert directed graph to undirected graph

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111181] Re: Convert directed graph to undirected graph
  • From: juan flores <juanfie at gmail.com>
  • Date: Fri, 23 Jul 2010 07:09:23 -0400 (EDT)
  • References: <i293nk$m3i$1@smc.vnet.net>

Dear Jon,

A plot is not a graph.  You may use the following:

Needs["Combinatorica`"];
Needs["GraphUtilities`"];
gr1 =
 ToCombinatoricaGraph[{1 -> 2, 2 -> 1, 3 -> 1, 3 -> 2, 4 -> 1, 4 -> 2,
    4 -> 4}]
ShowGraph[gr1]
gr1u = MakeUndirected[gr1]
ShowGraph[gr1u]

Regards,

Juan

On Jul 22, 4:41 am, Bob Hanlon <hanl... at cox.net> wrote:
> gr1 = GraphPlot[{
>    1 -> 2, 2 -> 1, 3 -> 1, 3 -> 2,
>    4 -> 1, 4 -> 2, 4 -> 4},
>   DirectedEdges -> True]
>
> gr2 = gr1 /. Arrow -> Line
>
> Bob Hanlon
>
> ---- Jon Harrop <use... at ffconsultancy.com> wrote:
>
> =============
> What is the recommended way of doing this in Mathematica?
>
> --
> Dr Jon Harrop, Flying Frog Consultancy Ltd.http://www.ffconsultancy.com



  • Prev by Date: Re: A Question About Directive
  • Next by Date: Re: A Question About Directive
  • Previous by thread: Re: Convert directed graph to undirected graph
  • Next by thread: Re: Convert directed graph to undirected graph