COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Dijkstra algorithm and DFS

• Email
• Follow

```I need the implementation of the following two problems in Matlab urgently...

Dijkstra algorithm

The input data are 1) the nodes and 2) the arcs between the nodes, and must be read by a file called &#8216;input.txt&#8217;. Program results, which will be the shorter route, must be store at a file called &#8216;output.txt&#8217;.

DFS (Depth-First-Search)

The input data are 1) the nodes and 2) the arcs between the nodes, and must be read by a file called &#8216;input.txt&#8217;. The results of the program, which are the dfnr, T, and the category which belong each arc, must be store at a file called &#8216;output.txt&#8217;
```
 0

See related articles to this posting

```i have the same problem as you!!!did you manage to find out??thnx in advance

"Talha Chohan" <talha.ahmed.chouhan@gmail.com> wrote in message <hf6gbe\$m30\$1@fred.mathworks.com>...
> I need the implementation of the following two problems in Matlab urgently...
>
>
>
> Dijkstra algorithm
>
> The input data are 1) the nodes and 2) the arcs between the nodes, and must be read by a file called &#8216;input.txt&#8217;. Program results, which will be the shorter route, must be store at a file called &#8216;output.txt&#8217;.
>
> DFS (Depth-First-Search)
>
> The input data are 1) the nodes and 2) the arcs between the nodes, and must be read by a file called &#8216;input.txt&#8217;. The results of the program, which are the dfnr, T, and the category which belong each arc, must be store at a file called &#8216;output.txt&#8217;
```
 0

```"kingkozad the wise":

Were you wise enough to check each of the 16 submissions in the File
Exchange on that?

http://www.mathworks.com/matlabcentral/fileexchange/?term=Dijkstra+
```
 0

2 Replies
797 Views

Similar Articles

11/30/2013 1:30:23 PM
page loaded in 45371 ms. (0)

Similar Artilces:

ALGORITHM
// MATCHCASE // REPLACE1WITHLOREPLACE2WITH + // REPLACE WITH2 REPLACE2P2WITH2LZ REPLACE2NP2WITH2L0

Algorithm
Hello I have made an application to visually compare a scanned printed document with the original document, to see whether the printer has done its job. I'm looking for a somewhat better/faster algorithm, I use pixel-per-pixel with some simple offset calculations, but it tends to be slow (1 minute for an A4 600 dpi B/W) even if it does it's job. The goal is to find missing dots, words, sentences or errors in artwork/color. OCR is not an option. In consideration is that the scanned document may be rotated, misaligned, slightly streched due to humidity, dirty, etc. If anyone can give...: > Hello > I have made an application to visually compare a scanned printed > document with the original document, to see whether the printer has > done its job. I'm looking for a somewhat better/faster algorithm, I > use pixel-per-pixel with some simple offset calculations, but it tends > to be slow (1 minute for an A4 600 dpi B/W) even if it does it's job. > The goal is to find missing dots, words, sentences or errors in > artwork/color. OCR is not an option. > In consideration is that the scanned document may be rotated, > misaligned, slightly streched

an autocompletion algorithm
does anyone know where i can get the algorithm for autocompletingentries just as it is done in desktop publishing applications?would appreciate some references.

Division algorithm
Hi I make a division algorithm but i don't know if is original. I search in net but no found this. please, goto www.reda4.org and see the code in R4, Assembly x86 and C. the idea is simple and short, first increase divisor for less substraction, and then decrease until 1 time substraction, it's all. I not test the asm version, I'm not sure if is ok, anyone can helpme in measure the speed ? I try to make an MMX version too. pabloreda <spamtrap@crayne.org> writes: > Hi > > I make a division algorithm but i don't know if is original. I search > in net but no found this. It's basically the same algorithm taught in schools since the beginning of time, but in base 2 rather than base 10. > please, goto www.reda4.org and see the code in R4, Assembly x86 and > C. The C version's broken: b-=b;sr-=sr; Presumably that should be b>>=1; sr>>=1; Hmm, having said that your asm version looks equally borken: sub ebx,ebx sub ecx,ecx sub a,a is not the inverse of add a,a in any language. Your Forth looks OK though, as you correctly divide by 2. Phil -- Dear aunt, let's set so double the killer delete select

sobi algorithm
I am working on my Msc thesis. I am trying to understand the following article: A. Belouchrani, K. Abed-Meraim, J.F. Cardoso and E. Moulines: "A blind source separation technique using second order statistics", IEEE Trans. on Signal Processing, vol. 45, no. 2, pp. 434-444, Feb. 1997. I founded out that the article is very dificult to understand. Do anybody in the group have additional material that gives a better understanding to the algorithm described in the article like lecture notes? I have found in the web few matlab programs that simulate this algorithm. in order to be sure that the program is working properly i would like to run the program with data that is used in the article in order to compare it to the figures in the article. can i get help do anybody has the original data used by the article authors? thanks in advance David On 5 juil, 22:45, david <dan1...@yahoo.com> wrote: > I am working on my Msc thesis. I am trying to understand the > following article: > > A. Belouchrani, K. Abed-Meraim, J.F. Cardoso and E. Moulines: > "A blind source separation technique using second order statistics", > IEEE

QR algorithm
I have to compute all the eigenvalues of a matrix A = 2.36 1 -59 -3 -6 51.1 2 -4.8 0 -3 1 12 6.8 1.65 -0.6 6 0 -8 13 -8 0 51.3 7 54.3 -2 in which the eigenvalue of maximum and minimum module are complex numbers with the QR algorithm. I used this algorithm that I write of my own but also after 100000 iterations, it won't return the eigenvalues on the diagonal of the result matrix function fattorizzazione_QR (A, nIter) A_a = A; n = 1; while (n < (nIter)) [Q, R] = qr(A_a); A_a = R*Q; n = n+1; end A_a diag(A_a) Thanks for any answer to my question and excuse for my english!!! In article <32824586.1140429663710.JavaMail.jakarta@nitrogen.mathforum.org>, dvoran <dvoran@libero.it> wrote: > I have to compute all the eigenvalues of a matrix > A = > 2.36 1 -59 -3 -6 > 51.1 2 -4.8 0 -3 > 1 12 6.8 1.65 -0.6 > 6 0 -8 13 -8 > 0 51.3 7 54.3 -2 > > in which the eigenvalue of maximum and minimum module are complex numbers > with the QR algorithm

stacking algorithm
Hi, I need some pointers on a good place to start with an algorithm to solve this problem. Given an arbitrary collection of lines with differing 'lengths' and starting points - like this: --------- (length = 9, start = 0) --- (length = 3, start = 2) -- etc ----------- ----- ----- --- And a fixed width 'tray' to place them in, like this: |____________| (length = 12) I need to find a way to 'stack' them in a reasonably efficient way - like this: (Gaps in between lines shown for clarity) --- ----- -- --- ----- --------- ----------- |____________| TRAY The code I inherited just checks the starting point of the current line being processed against the ending point of the previous line being processed and if there is overlap it moves the current line up a level in the stack. This creates situations like this: ------ ---------- -------- The requirements team wants something like this instead: ---------- -------- ------ I figure this has to be a pretty common problem. I did a google search but didn't find anything. Can anyone suggest an algorithm which is similar or does anyone have

Tarjan algorithm
[First posted to comp.graphics.algorithms but seems inapropriate] Hi, Could you give me or tell me where can i find a step by step description of Tarjan's algorithm, the one which finds the strongly connected components of a directed graph ? I only know it performs a DFS (depth first search) and a vertex numbering. An applet would be suitable. Surpringly, a classical reference as Cormen and al doesn't deal with original Tarjan algorithm but rather with Kosaraju's algorithm. Thanks, Alex Al wrote: > [First posted to comp.graphics.algorithms but seems inapropriate] > > Hi, Could you give me or tell me where can i find a step by step > description of Tarjan's algorithm, the one which finds the strongly > connected components of a directed graph ? I only know it performs a DFS > (depth first search) and a vertex numbering. An applet would be suitable. > > Surpringly, a classical reference as Cormen and al doesn't deal with > original Tarjan algorithm but rather with Kosaraju's algorithm. > The even more classical book by Aho, Hopcroft and Ullman also uses Kosaraju's algorithm. It only mentions that Tarjan

Simplex Algorithm
I'm looking for implementaction Simplex Algorithm in PHP. Do you have the simplex algorithm? the code in php please.... :o)

Pythonic A*-Algorithm
Hi, I'm looking for an A* implementation in Python (at least some wrapper around a C lib). So far I've only found http://arainyday.se/projects/python/AStar/ which looks not so promising. http://wiki.python.org/moin/PythonGraphApi lists all major available graph libraries in Python, hoping to find a path to some standard Python graph library (as DBAPI). But none of them seems to have a decent A*-implementation (at least with Fibonacci-heap, as pqueue is supposed to be). I know I could implement it myself as it is not that complicated, but I would rather like to align my project

Watershed algorithm
Hello every one, I am looking for websites which explain logic behind watershed algorithm.Can any one help me in this matter Thanks, Niranjan niranjan wrote: > > > Hello every one, > > I am looking for websites which explain logic behind watershed > algorithm.Can any one help me in this matter > > Thanks, > Niranjan I uploaded a pdf doc for you: <http://gfleutot.free.fr/bordel/matlab/par_watershed.pdf> Otherwise, look at this website: <http://www.google.com/search?hl=en&lr=&q=watershed+algorithm&btnG=Search> .... google is your best friend! Matlab's help gives the name of an article: Vincent, Luc, and Pierre Soille, "Watersheds in Digital Spaces: An Efficient Algorithm Based on Immersion Simulations," IEEE Transactions of Pattern Analysis and Machine Intelligence, Vol. 13, No. 6, June 1991, pp. 583-598. , if you want to buy literature. Gauthier niranjan <tniranjan9@yahoo.co.in> wrote in message <eeecb77.-1@webx.raydaftYaTP>... > Hello every one, > > I am looking for websites which explain logic behind watershed > algorithm.Can any one help me in this matter > > Thanks

Complexity of algorithm?
Hi, Suppose I have \$k\$ values to compute and the algorithm to compute one value needs \$k\$ multiplications. If I do the computations serially, I will need \$k\$ * \$k\$ operations to do the computations, yielding O(k^2) complexity. However, if I compute the \$k\$ values in parallel (using special hardware), the time needed would be proportional to \$k\$. Is there a special term to denote this difference (NP hard)? Your time, effort and suggestions will be greatly appreciated Jaco Versfeld (jaco underscore versfeld at ieee dot org : for email) Jaco Versfeld wrote: > Hi, > > Suppose I have \$k\$ values to compute and the algorithm to compute one > value needs \$k\$ multiplications. If I do the computations serially, I > will need \$k\$ * \$k\$ operations to do the computations, yielding O(k^2) > complexity. However, if I compute the \$k\$ values in parallel (using > special hardware), the time needed would be proportional to \$k\$. Is > there a special term to denote this difference (NP hard)? > > Your time, effort and suggestions will be greatly appreciated > Jaco Versfeld > > (jaco underscore versfeld at ieee dot org : for email) Probably just "

Encryption algorithm
I am looking for a simple encryption algorithm to encrypt a 13 character alphanumeric string in a COBOL program. Any help will be appreciated. Thanks, Vik Vik Mehta wrote: > I am looking for a simple encryption algorithm to encrypt a 13 > character alphanumeric string in a COBOL program. Any help will be > appreciated. Find a 10-character word with no repeating letters (i.e., "manuscript") then INSPECT ... CONVERTING "Vik Mehta" <aul1231@yahoo.com> wrote in message news:2df8b8ca.0401070700.67c3ec95@posting.google.com... > I am looking for a simple encryption algorithm to encrypt a 13 > character alphanumeric string in a COBOL program. Any help will be > appreciated. > Presumably you want the encryption as a COBOL Subroutine? You will need a COBOL compiler that supports the XOR function. (Microfus and Fujitsu do.) "Here's one I prepared earlier..." (MUCH earlier...over 6 years ago, in fact. It works extremely well despite being simple, and is ideal for short strings that need encryption before writing to a database or file (like passwords).) Remove anything in square brackets "[...]" before

Huffmann Algorithm
Hi ! Could anyone explain me how can I find how many level (at least and at most) there are in an Huffmann tree with N symbols ? Jack Bauer Hi, > Could anyone explain me how can I find how many level (at least and at most) > there are in an Huffmann tree with N symbols ? Sounds pretty much like a homework assignment to me, thus I'm only giving hints. Hint 1: How does the worst (highest) huffman tree look like? If so, how many leaves does it take to built a huffman tree of a given height? Then reverse the formula. Hint 2: How does the best (shortest) huffman tree look like? H

Simplex algorithm
for linear programming as an option. Often people become confused about the Nelder/Mead "simplex" algorithm, thinking it is related. For this reason, I tend to call it a "polytope" algorithm, avoiding the name "simplex" here. Nelder/Mead is found in the fminsearch function. Even so, you cannot simply force lsqcurvefit to use a polytope method as its method of search, nor generally, would you wish to do so. John "Richard Murray" <richmurray_@hotmail.com> wrote in message <fhh4e3 \$qu8\$1@fred.mathworks.com>... > Hi, > > Is it possible to do... confused about the Nelder/Mead "simplex" algorithm, thinking it is related. For this reason, I tend to call it a "polytope" algorithm, avoiding the name "simplex" here. Nelder/Mead is found in the fminsearch function. Even so, you cannot simply force lsqcurvefit to use a polytope method as its method of search, nor generally, would you wish to do so. John "Richard Murray" <richmurray_@hotmail.com> wrote in message <fhh4e3 \$qu8\$1@fred.mathworks.com>... > Hi, > > Is it possible to do the following, > > options = optimset

Algorithm ideas
i'm a grad student who got stuck with her previous topic and a has to find a new one. i have backgorund in math, DSP, image-processing, optimization, pattern recognition and data fusion. i'm looking for algorithm ideas, preflebly that have practical or industrial applications, can be in any domain. if anyone knows of a new problem that requires a non-trivial algorithm, i'll be happy to hear about it. many thanks, christine crasmuse@yahoo.ca (Christine Rasmusen) wrote in message news:<6aa88d11.0407312108.49b99b36@posting.google.com>... > i'm a grad student who got stuck with her previous topic and a has to > find a new one. > > i have backgorund in math, DSP, image-processing, optimization, > pattern recognition and data fusion. > > i'm looking for algorithm ideas, preflebly that have practical or > industrial applications, can be in any domain. if anyone knows of a > new problem that requires a non-trivial algorithm, i'll be happy to > hear about it. Your background sounds very good for the type of problems you want to work with. Maths and DSP are very good backbones for any kind of problem solving, optimization

Hashing algorithm
Hi, Can anyone help me with the code to hash strings? Ideally, not MD5, but SHA1... 256 is fine. Thanks, Vickie G.

BCJR algorithm
I need numerical examples or simple m-file about the BCJR algorithms: someone could help me? Thanks, Luca

shooting algorithm
Hi, can some one give me matlab codes for shooting algorithm? thanks in advance! shailendra shailendra wrote: > > > Hi, > > can some one give me matlab codes for shooting algorithm? > > thanks in advance! > > shailendra Google gives 4280 answers, for example: <http://www.amath.washington.edu/courses/301-autumn-2003/301lec16.pdf> /Per

exponential algorithm
I need an algorithm for computing the exponential of a real number using only elementary operations (addition, subtraction, multiplication and/or division). I have a PLC (Programmable Logic Controller - used in industrial controls) as the processor. It has no built-in math functions other that the above. I need to convert a voltage from a pressure transducer to a displayed value. The transducer output is scaled to produce X volts per decade of pressure e.g. 1 volt is 1.6e-10 Torr, 1.6 volts is 1.6e-9 Torr. The conversion formula is; pressure = 10^(1.667*Voltage - 11.46). I only need 2 - 3 significant figures for the display. I've tried using a Taylor series but even with 5 terms it is only good over a small range. The available memory would only support a small look up table. Any other ideas? Any references? Thanks Max Miller Ushio America, Inc. kc6zut wrote: > I need an algorithm for computing the exponential of a real number using > only elementary operations (addition, subtraction, multiplication and/or > division). I have a PLC (Programmable Logic Controller - used in > industrial controls) as the processor. It has