Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2674

Bug: Combinatorica Neighborhood doesn't do anything.

From BernieTheJet <berniethejet@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Bug: Combinatorica Neighborhood doesn't do anything.
Date 2011-05-24 09:58 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <irfvgr$bti$1@smc.vnet.net> (permalink)

Show all headers | View raw


I am not sure what the relationship between Combinatorica and the
built in Mathematica functions is anymore.  It seems a lot of Combinatorica
has been moved to the kernel.  That being said, I believe there is no
kernel Neighborhood function for graphs yet, and if so, the one in
Combinatorica doesn't do much of anything:

So, for example, try:

GraphPlot[ nn = {1 -> 2, 1 -> 3, 2 -> 5, 2 -> 3, 3 -> 4, 4 -> 3, 3 ->
6,  5 -> 6}, VertexLabeling -> True, DirectedEdges -> True]

Then

Needs["Combinatorica`"]

and

Neighborhood[nn, 2, 1]

Out[3] = {2, 1 -> 3}

which makes no sense.  The answer should be {3,5}.

Even better, try:

Neighborhood[nn, 2, 2]

Out[4]=
Part::pspec: Part specification {2,1->3} is neither an integer nor a
list of integers. >>
Part::pspec: Part specification {2,1->3} is neither an integer nor a
list of integers. >>
Union::heads: Heads Part and List at positions 2 and 1 are expected to
be the same. >>

{2, 1 -> 3} \[Union] {1 -> 2, 1 -> 3, 2 -> 5, 2 -> 3, 3 -> 4, 4 -> 3,
3 -> 6, 5 -> 6}[[{2, 1 -> 3}]]

which is even more entertaining.

regards,

Bernard

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Bug: Combinatorica Neighborhood doesn't do anything. BernieTheJet <berniethejet@gmail.com> - 2011-05-24 09:58 +0000

csiph-web