LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-02-2004, 11:21 AM   #1
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Rep: Reputation: 30
reverse warshall algorithm


Code:
void warshall(int a[100][100],int n)
{
int q,i,j;
for(q=1;q<=n;q++)
for(i=1;i<=n;i++)
for(j=1;j<=n;j++) 
if(((i!=q)&&(j!=q)&&a[i][j]==0)&&(a[i][q]==1)&&(a[q][j]==1)) a[i][j]=1;
}
This is roy-warshalls algorithm. I get from the adjacency matrix the path matrix. I want to obtain from the path matrix the adjacency matrix. How can I do that ? Have any suggestions ?

Thank you!

Last edited by spank; 02-04-2004 at 12:03 PM.
 
Old 02-03-2004, 05:53 PM   #2
wapcaplet
LQ Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Rep: Reputation: 48
I dunno. What's an index matrix?
 
Old 02-04-2004, 12:02 PM   #3
spank
Member
 
Registered: Aug 2003
Location: Romania
Distribution: Ubuntu 6.06
Posts: 278

Original Poster
Rep: Reputation: 30
adjacency... sorry about that. my terminology is bad because english is not my native language.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best cryptographic algorithm? Linux.tar.gz Linux - Security 19 05-02-2006 08:54 PM
Which sorting algorithm? nodger Programming 6 01-28-2005 06:13 PM
Airsnort Algorithm inthefuture Linux - Security 1 08-26-2004 10:01 PM
Do you memorize the algorithm?For... shakedown1987 Programming 5 08-05-2004 07:21 AM
intelligent algorithm raven Programming 1 01-27-2002 09:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration