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

MathGroup Archive 2009

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

Search the Archive

Re: A newbee to Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97203] Re: [mg97170] A newbee to Mathematica
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Sun, 8 Mar 2009 05:49:49 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200903070737.CAA16881@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

I don't understand the line of code that begins:

    g[FromAdjacencyMatrix[am, EdgeWeight], ...




Nishant wrote:
> Hi I have just started using mathematica,and therefore have a very silly question that needs an answer.
> I am trying to run this:
> Needs["GraphUtilities`"]
> Needs["Combinatorica`"]
> am = {{1, 0, 1, 2, 0, 1, 2}, {0, 0, 0, 0, 1, 1, 1}, {1, 0, 0, 1, 1, 1,
>      1}, {0, 3, 1, 4, 1, 0, 1}, {0, 1, 1, 1, 0, 1, 0}, {1, 1, 1, 0, 1,
>      0, 0}, {1, 1, 5, 1, 0, 0, 0}};
> 
> MatrixForm[am]
> g[FromAdjacencyMatrix[am, EdgeWeight], VertexLabeling -> True, 
>  EdgeLabeling -> True]
> GraphPlot3D[g]
> I am getting this error message:
> GraphPlot3D::grph:Graph:<11,7,Undirected> is not a valid graph. 
> 
> BASICALLY what I want to do is to generate a 3d graph from a given adjacency matrix,with the elements of the matrix showing the weights of each edge as is provided in FromAdjacencyMatrix[g,Edgeweight]
> 
> Thank you for helping me out
> 

-- 
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: Re: Mathematica 7.0.1.0 and some General Comments
  • Next by Date: Re: Re: Re: "Do What I Mean" - a suggestion for
  • Previous by thread: A newbee to Mathematica
  • Next by thread: Re: A newbee to Mathematica