• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Create and Graph an odd tree structure

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.

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

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

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

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.

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

How could I graph this in java?

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?

Any good websites, or tutorials on this subject?

Thanks a lot!

Posts: 26771
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.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic