Sorry, I misunderstood the question. The thing you are looking for is called JUNG , the universal Java network / graphics library. It can store, display and calculate various indicators on sparse or dense graphs. The official website has great designs.
Quote from the site above:
βThe JUNG architecture is designed to support a variety of representations of entities and their relationships, such as directional and undirected graphs, multimodal graphs, graphs with parallel edges and hypergraphs. It provides a mechanism for annotating graphs, objects, and relationships with metadata, which makes it easy to create analytical tools for complex "datasets that can examine relationships between objects, as well as metadata associated with each object and relationship."
mbatchkarov
source share