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


Groups > comp.soft-sys.math.mathematica > #1304 > unrolled thread

Combinatorica

Started byjanos <janostothmeister@gmail.com>
First post2011-03-31 08:58 +0000
Last post2011-04-02 07:50 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Combinatorica janos <janostothmeister@gmail.com> - 2011-03-31 08:58 +0000
    Re: Combinatorica "Jon Harrop" <usenet@ffconsultancy.com> - 2011-04-02 07:50 +0000

#1304 — Combinatorica

Fromjanos <janostothmeister@gmail.com>
Date2011-03-31 08:58 +0000
SubjectCombinatorica
Message-ID<in1fno$4c5$1@smc.vnet.net>
We have a lot of serious problems with Combiantorica, the main one
being the ConnectedComponents and HamiltonianQ cannot be used
together. Here is the content of our notebook. (By the way, is there
any way attachig a file here? Seems to be an old problem.)

At first a graph is constructed

L = Graph[{1 \[UndirectedEdge] 2, 1 \[UndirectedEdge] 3,
   2 \[UndirectedEdge] 3, 2 \[UndirectedEdge] 4, 2 \[UndirectedEdge]
6,
   3 \[UndirectedEdge] 5, 3 \[UndirectedEdge] 7, 4 \[UndirectedEdge]
6,
   5 \[UndirectedEdge] 7, 6 \[UndirectedEdge] 7, 6 \[UndirectedEdge]
8,
   7 \[UndirectedEdge] 8}]

{VertexList[L], EdgeList[L], VertexCount[L], EdgeCount[L]}

ConnectedComponents[
 Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \
[UndirectedEdge] 1,
   4 \[UndirectedEdge] 5}, VertexLabels -> "Name", ImagePadding -> 5]]

am = AdjacencyMatrix[L]

 AdjacencyGraph[AdjacencyMatrix[L]]

FromAdjacencyMatrix and ToAdjacencyMatrix are not built in.

So far so good. Let us invoke the package.

<< Combinatorica`

A lot of functions, like Graph, ConnectedCompomnents will not function
any more.

Graph[{1 \[UndirectedEdge] 2, 1 \[UndirectedEdge] 3, 2 \
[UndirectedEdge] 3,
  2 \[UndirectedEdge] 4, 2 \[UndirectedEdge] 6, 3 \[UndirectedEdge]
5,
  3 \[UndirectedEdge] 7, 4 \[UndirectedEdge] 6, 5 \[UndirectedEdge]
7,
  6 \[UndirectedEdge] 7, 6 \[UndirectedEdge] 8, 7 \[UndirectedEdge]
8}]

ConnectedComponents[
 Graph[{1 \[UndirectedEdge] 2, 2 \[UndirectedEdge] 3, 3 \
[UndirectedEdge] 1,
   4 \[UndirectedEdge] 5}, VertexLabels -> "Name", ImagePadding -> 5]]

ConnectedComponents[L]

HamiltonianQ is avaliable but it does not work

HamiltonianQ[L]

HamiltonianCycle[L]

AdjacencyGraph[am]

FromAdjacencyMatrix[am]

FromAdjacencyMatrix[nam = Normal[am]]

Use of sparse matrices are discouraged, they are incompatible with
Combinatorica.

MatrixForm[am]

HamiltonianQ[AdjacencyGraph[am]]

HamiltonianQ[AdjacencyGraph[nam]]

HamiltonianQ[FromAdjacencyMatrix[nam]]

{V[L], M[L]}

{V[AdjacencyGraph[am]], M[AdjacencyGraph[am]]}

{V[AdjacencyGraph[nam]], M[AdjacencyGraph[nam]]}

{V[FromAdjacencyMatrix[nam]], M[FromAdjacencyMatrix[nam]]}

[toc] | [next] | [standalone]


#1431

From"Jon Harrop" <usenet@ffconsultancy.com>
Date2011-04-02 07:50 +0000
Message-ID<in6kfs$2i7$1@smc.vnet.net>
In reply to#1304
"janos" <janostothmeister@gmail.com> wrote in message 
news:in1fno$4c5$1@smc.vnet.net...
> We have a lot of serious problems with Combiantorica...

Indeed, from what I can gather many of the functions in Combinatorica have 
never worked. I was recently struggling to get NetworkFlow to do anything 
but hang Mathematica even on the most trivial inputs when I discovered that 
this question has been asked repeatedly over the years:

https://groups.google.com/group/comp.soft-sys.math.mathematica/browse_thread/thread/5280780aaebc2158

and it is on the list of known bugs:

http://www.cs.uiowa.edu/~sriram/Combinatorica/knownBugs

In particular, the BellmanFord, NetworkFlow, ShortestPath, 
UnrankPermutation, GraphJoin, GraphProduct, GraphSum and SetEdgeWeights 
functions are known to either not work at all or not work properly. The 
first three are some of the most fundamental graph algorithms...

Cheers,
Jon.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web