Relations between 2 objects

For some partial reason, there is a need to build relationships between objects. Objects of any kind. For example, math problems. Is a problem generalization of another math problem? stuff like that. It's usually relations between 2 different objects.
Generally, there are 4 kind of relations I need to consider about:
Type 0: Not commutative or transitive.
Ex: Like. I like chicken, chicken like bugs. I don't like bugs and chicken doesn't like me.

Type 1: Commutative but not transitive
Ex: Married to.

Type 2: Transitive but not commutative
Ex: Ancestor of.

Type 3: Transitive and commutative
Ex: Same age?

Now I need to find a way to map each kind of relation easily.
Let V be the set of all objects. then
Type 0: is a digraph that maps out every relationship.
Type 1: is a graph that maps out every relationship.
Type 2: is a digraph maps, all the relation can be found by calculating it's transitive closure.
Type 3: is a partition of the set V.

For type 0,1 and 3, insertion and deletion of items are easy.(Move = deletion + insertion).

For type 2, delete an element(or relation) need to be defined.
Its either delete 1 relation and remove all a set of other relations because it depend on the transitive property.
Or delete 1 relation, and maintain all other relations in tact.
Delete an object is the same as deleting a lot of relations.

Type 2 is pretty useful. For example:
There is a bunch of sets, we know the definition of each set by it's unions.
We know every set's definition from the union of other sets. For instance
A = B union {1,2}
B = C union D
C = {5,6}
D = {5,7}
E = {3,4} union D
then A = {1,2,5,6,7}
Each set becomes a object.
Union A and E = {1,2,3,4,5,6,7}
if we do it naively, by finding A then find E. then there is a need of 5 unions. Since we already know E contains D. only 4 unions are required.
When there is a lot of unions, and it's very likely a large amount of them will overlaps, having a nice program to do type 2 relations can greatly reduce the amount of unions required.

This sound like something fun to do for CSE Honors project in my senior year. but I have a feeling someone did it before.


Comments

Post new comment

  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <fn>
  • Lines and paragraphs break automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Mathematical equations and graphs can be added between [tex] and [/tex], [graph] and [/graph] tags.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Honey Pot that kill bots