473,396 Members | 2,013 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,396 software developers and data experts.

Need help: Is Quick-Union-Find the right solution to this problem (Now I don't think so and I think that topological sorting should be the way to go...?) ?

On Sun, 10 Apr 2005 19:46:32 GMT, ar**********@yahoo.com wrote:
The user can dynamically enter and change the rule connection between
objects. The rule is a "<" and so given two objects:
a < b simply means that b < a can't be set, also it must be a != b.
And with three objects a < b , b < c means a < c

I studied Quick Union Find algorithms a bit and if I understood them
correctly, once the user gives the input setting the rules/connection
between objects, the algorithm will give as output the result of the
solved connections between objects.

As far as I check on the array or given list of objects from user
input that it's never added anything like a = b nor b<a when a<b it's
already in the list, would it work as expected so that I know which
objects in the list are "the strongest" ones as per user given rules ?

I tried thinking about using simple logic like AND,OR,XOR of compare
results values but I couldn't find a way to ensure that the
transitivity rule could be mantained.

So, is a DAG or Quick Union Find the way to go ?

My only concern about Quick Union Find is that it constructs a graph
with a single highest level root like a tree, right ? But if I am not
wrong the user could set things in such a way that the graph would
have more than one "root" .. ?!

Someone please help me to understand what's the right thing I should
use, and the simpler one that would still let me solve the "which is
stronger" among the user given objects and user set rules.

After a bit of searching I think that I should use DAG and Topological
Sorting, right ?
Topological sorting on a DAG graph in which the user input can be
checked to avoid reflexive property to be inserted should do the
trick, no ?
Regarding transitivity property to tell the user that a given rule
can't be accepted I have to build up the topological sort list and
check on it everytime, right ?

Or, is there any simpler way to have all of this work without building
up a graph and doing topological sorting on it and so on ?

Nov 14 '05 #1
1 2604
On Tue, 12 Apr 2005 17:06:49 GMT, ar**********@yahoo.com wrote in
comp.lang.c:
On Sun, 10 Apr 2005 19:46:32 GMT, ar**********@yahoo.com wrote:
The user can dynamically enter and change the rule connection between
objects. The rule is a "<" and so given two objects:
a < b simply means that b < a can't be set, also it must be a != b.
And with three objects a < b , b < c means a < c

I studied Quick Union Find algorithms a bit and if I understood them
correctly, once the user gives the input setting the rules/connection
between objects, the algorithm will give as output the result of the
solved connections between objects.

As far as I check on the array or given list of objects from user
input that it's never added anything like a = b nor b<a when a<b it's
already in the list, would it work as expected so that I know which
objects in the list are "the strongest" ones as per user given rules ?

I tried thinking about using simple logic like AND,OR,XOR of compare
results values but I couldn't find a way to ensure that the
transitivity rule could be mantained.

So, is a DAG or Quick Union Find the way to go ?

My only concern about Quick Union Find is that it constructs a graph
with a single highest level root like a tree, right ? But if I am not
wrong the user could set things in such a way that the graph would
have more than one "root" .. ?!

Someone please help me to understand what's the right thing I should
use, and the simpler one that would still let me solve the "which is
stronger" among the user given objects and user set rules.

After a bit of searching I think that I should use DAG and Topological
Sorting, right ?
Topological sorting on a DAG graph in which the user input can be
checked to avoid reflexive property to be inserted should do the
trick, no ?
Regarding transitivity property to tell the user that a given rule
can't be accepted I have to build up the topological sort list and
check on it everytime, right ?

Or, is there any simpler way to have all of this work without building
up a graph and doing topological sorting on it and so on ?


Look back at your question, and your follow-up to your own question,
quoted above. Notice not one single mention of the C programming
language, which is our topic here. Algorithm selection is in fact
programming language independent.

If you want advice on choosing an algorithm, you should ask in a group
like news:comp.programming.

Once you have selected your algorithm, if you have difficulties
implementing it in standard C, then post your code here and explain
your problem with it, and we can help.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #2

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

Similar topics

8
by: George Hester | last post by:
In a page I have when the user left-clicks the page a Input box for a form gets the focus. But if the user right-clicks the page the Input box is not getting the focus. I'd like the Input box to...
6
by: greenflame | last post by:
I need code to compute the determinant and inverse of a matrix. for example the determinant and inverse of:
2
by: WantedToBeDBA | last post by:
Hi all, We have db2 installed on AIX box (db2 version - 8.1). Its started and i am able to view 50000(default port) in netstat(netstat -a -n). But when i try to connect using telnet, i am getting...
0
by: pei_world | last post by:
Hi there, basically, I am doing a project like, client(cell phones) and server(c# pc), I want to let them communicate and send data to earch other using Bluetooth. and I am not quit sure what...
1
by: Mike Schwarz | last post by:
hi me migrated to new webserver 2003 now, aspnet is not working anymore following error System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72...
1
by: STA | last post by:
Hi. Given this XML: <itemdata> <item> <itemid>10</itemid> <ctid>1</ctid> </item> <item> <itemid>11</itemid>
1
by: Jaikrishnan | last post by:
Hi Friends, I recieved a mail contains .mdb file.When i downloaded and try to open that file i got the following error. The current user account doesn't have permission to convert or enable...
1
by: imranay | last post by:
hey is there some body to tell me what will be the next step after imorting website. i have importeb my website named cruel_digger to yahworld.com but i dont know the nect step please help this dull...
1
Sasikumar B
by: Sasikumar B | last post by:
HI All, Please help me. I want to avoid someone deleting/replacing my mdb file kept on network. Our MDB Application file was used bye users in network so we cant avoid giving read /write access...
2
by: alamraman | last post by:
Hi Dear's, I need sulotions for this script. I am using CS3 Profissional software version 9. now i am learning AS3 from flash help, first time i am creating one script is ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.