Re: A weird requirement - unable to think of anything...



Legend wrote:

Thank you... Incase I want to construct a double linked list for this
data, how would I be doing that? Consider each vertex as an element or
each number as one element?

Again: This is prior-art for graph theory, so look it up.

Briefly, saying "1 is connected to 3" could appear in an "adjacency matrix",
like this:

1 2 3
1 - - *
2 - - *
3 * * -

You could program that as a sparse matrix, or as a real matrix in a 2D
array.

However, the algorithm you select will determine the data representation,
not the other awy around. That is the point of any algorithm - converting a
problem into an expression of the solution, so you can then pull the
solution out of the expression.

--
Phlip


.



Relevant Pages

  • Re: Problem on an nxn grid
    ... "See Spot Run" in the vocabulary of Graph Theory. ... Gibbons's "Algorithmic Graph Theory" gives a pseudo-code ... parts of the Edmonds algorithm (such as the Hungarian ... but might reduce the real-world CPU time in cases ...
    (sci.math)
  • Re: Optimization
    ... in computer architecture have probably more influence on the underlying lower-level algorithms such as QP, matrix factorization, sparse matrix tecnhniques etc. E.g. differences in cache behavior may influence a sparse matrix factorization algorithm and its implementation but has less impact on the SQP algorithm itself. ...
    (sci.math.num-analysis)
  • Re: Algorithm
    ... > I was wondering if someone would mind giving an algorithm that if a DFA ... > contain a nonproductive state. ... DFA's are a special case of graph theory. ...
    (comp.lang.cpp)
  • help
    ... I am a beginner of genetic algorithm. ... My major is Graph Theory. ... I want to ask which books and ... papers I must read for a beginner.Now I study the ant algorithm. ...
    (comp.ai.genetic)