Java: how to represent graphs?

Each node is named uniquely and knows who it is connected to. The List of connections allows for a Node to be connected to an arbitrary number of other nodes. public class Node { public String name; public List<Edge> connections; } Each connection is directed, has a start and an end, and is weighted. public … Read more

Family Tree Algorithm

Update: This is not the best solution I have come up with, but I’ve left it because there are so many comments relating to it. You have a set of events (birth/death), parental state (no descendants, parent, grandparent, etc) and life state (alive, dead). I would store my data in structures with the following fields: … Read more

Extracting segments from a list of 8-connected pixels

Using Mathematica 8, I created a morphological graph from the list of white pixels in the image. It is working fine on your first image: Create the morphological graph: graph = MorphologicalGraph[binaryimage]; Then you can query the graph properties that are of interest to you. This gives the names of the vertex in the graph: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)