• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Create and Graph an odd tree structure

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Experts,

Please forgive the seemingly dumb questions.
I don't work with trees or this kind of low level programming much.

I'm working on a tech problem, and I want to present the answer in a visual graph


------

It has some interesting requirements/characteristics.

a)
One node can have many children. Say 20. Maybe more.
ie. one library can be used by many objects.

b)
A child node can have many parents. Say 20. Maybe more.
ie. many libraries are used by one procedure

c)
A particular node can appear in more than one place.
ie. a generic print, or logging function is called in many procedures


Note:
This is just an -example- in tech terms I expect you will understand.
It is NOT the issue I need to model. No need to discuss it.


------

As I thought about this, it's clearly not a binary tree.


1)
What kind of data structure could I save all the data in?


2)
How could I graph this in java?


3)
What is a free open source graphing software that could graph such a tree?
Such as Neo4j

Perhaps in formats:
- as a tree, with a root, trunk, branches, and leaves?
- Like the graphs you see now, depicting social networks, with the root node in the center?


4)
Any good websites, or tutorials on this subject?



Thanks a lot!

 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, it isn't a tree, because it doesn't have a root node. So all of those ideas which were tree-based aren't right. As far as I can see it's just a graph -- any node can be connected to any other node.

As for storing the data, you wouldn't usually store data in anything resembling the structure you would use to display it. For example you wouldn't store data which you displayed as a tree in some kind of tree thing, you'd just store the nodes and their relationships in probably a database table or two. Likewise for this: store the nodes and their relationships.
 
Talk sense to a fool and he calls you foolish. -Euripides A foolish tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic