I am learning Clojure and Functional Programming and I am facing another problem that I am stuck and I have no idea how to deal with it. Here is the problem:
I have a vector of vectors:
[[a b][b c][c d][d e][e f][f g][f h][b i][d j][j l][l m][a n][a o][o p]]
And I need to establish a relationship between some of the items. The relationship rules are:
1 - Every item that has the same value as the first column has a direct relationship.
2 - If there is any item with the first column equals the second column from the rule 1, there is also a relationship, but an indirect one.
In our scenario the relationship would be:
Relationship for a (rule 1):
[[a b][a n][a o]]
Relationship for a (rule 2):
[[b c][o p]]
After that I also need to calculate, but I can't figure out how to do this the Functional Programming style with clojure. I have been working with O.O. Programming since 2008 and this is the first time I am learning functional programming.
Any ideas?
Thanks in advance.
[[b c] [b i] [o p]]- leetwinski