473,379 Members | 1,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Algorithm to identify network differences

I've got a problem where I have to identify differences in network. The
network may have different types of nodes and may only have a string of
ring-like topology:
Code:
A--B--C--D--E

or

A--B--C--D--E
| |
+-----------+

What I must do is identify the simplest way to change Network 1 into
Network 2
For example:

Code:
Network 1:

A--D--C--B

Network 2:

A--B--C--D

Solution: Swap nodes B and D
Another example:

Network 1:

A--B--C--D--E

Network 2:

A--B--C--D--E
| |
+-----------+

Solution: Connect node E to node A
NOTE: This is not a homework problem. This is a work-related problem.
My current solution is to run through a set of possible problems and
analyze each one. Something like this:

* Compare network topologies: (string-like or ring-like)
* Count the number of nodes on each network.
* Identify which nodes are identical and which are different.
* Does the topology type (string vs. ring) need to change? If so, what
is the simplest fix?
* Are 2 nodes swapped? If yes, identify which ones.
* Are 3 nodes different? Then...
* etc...

This does not seem like the most efficient way of doing things, and it
seems like this is something that someone would have worked out in
acadamia somewhere.

My question: Is there a well known algorthm for this sort of problem?

Many thanks!

- Kevin

Jul 23 '05 #1
4 2026
Kevin asked
I've got a problem where I have to identify differences in network. The network may have different types of nodes and may only have a string of ring-like topology: For example:
A--D--C--B
A--B--C--D
Solution: Swap nodes B and D


You are looking for an "edit script" to convert one to the other.
Typically an edit script list the inserts and deletes needed to go from
one to the other, but you mention swaps; presumably a script listing
inserts and deletes could be converted to one that also used swaps in
some fairly simple way. Apart from that, this is a standard problem;
it's what the "diff" program solves. I can point you to some GPL C++
code to solve it if you are interested. Otherwise, try to find "An
O(ND) Difference Algorithm and Its Variations" by Eugene W Myers; the
PDF is out there somewhere and is quite readable.

Your variation on this is that you also have rings. A naive solution
is to consider each point where the ring could be broken to form a
string and find the edit script in each case, then select the one with
the simplest script. Alternatively, I wonder if Myers' algorithm could
be transformed to "wrap around" at the edges?

--Phil.

Jul 23 '05 #2
Thanks for the reply. That helps a bunch. I appreciate the idea about
considering the parts connecting the nodes as nodes themselves --
either "good connection" or "bad connection".

I will take a look at Myer's paper. In the mean time, would you mind
posting the links to the GPL C++ code you mentioned?

Thanks again!

- Kevin

Jul 23 '05 #3
> would you mind posting the links to the GPL C++ code you mentioned?

Download http://chezphil.org/anyterm/anyterm-0.14.tbz2 and look at
apachemod/diff.*

--Phil.

Jul 23 '05 #4
Thanks again!

Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Alex Ang | last post by:
I have written the following VBScript program. It is stored into a file "map_drive.vbs". It successfully mapped to a network drive \\server1\data. Dim WshNetwork Set WshNetwork =...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
4
by: Goh | last post by:
Hi, I would like to know how can we implement a web page that intelligent enough to unique identify that pc have been visit before without any cookies and login user require. I have try...
3
by: Julia | last post by:
Hi, there, My task is: There is a network of intersected lines, e.g., a road network. What I have is a list of lines, and each item in the list includes the coordinates of points on each...
2
by: shun | last post by:
Hello Friends, i am dealing a project, in which i stuck here, the problem is i am new to VC++.net so i need a friends help to solve this problem. I have to identify a system which is...
2
by: Julio C. Hernandez Castro | last post by:
Dear all, We have just developped a new block cipher called Raiden, following a Feistel Network structure by means of genetic programming. Our intention now consists on getting as much feedback...
6
by: StephQ | last post by:
I need to implement an algorithm that takes as input a container and write some output in another container. The containers involved are usually vectors, but I would like not to rule out the...
6
by: Ryan Liu | last post by:
Hi, If I want to uniquely identify a computer. I can read CPU ID or Mac Address. I heard, but is this true: some BIOS can block CPU ID from being read? (In this case, will I get an exception,...
1
by: Glenton | last post by:
Hi All Here is a very simple little class for finding a shortest route on a network, following Dijkstra's Algorithm: #!/usr/bin/env python #This is meant to solve a maze with Dijkstra's...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.