About 336,000 results
Open links in new tab
  1. Java: how to represent graphs? - Stack Overflow

    Nov 15, 2009 · The Graph class represents an undirected graph of vertices named 0 through V - 1. It supports the following two primary operations: add an edge to the graph, iterate over all of …

  2. java - Graph node and edge modeling in UML diagram - Stack Overflow

    Aug 12, 2014 · What would be the most correct/elegant way to model the relationship between a graph edge class and a node class in a UML class diagram? I would normally use two …

  3. graph - Creating an edge from a node in Java - Stack Overflow

    public class Edge { Node start; Node end; int cost; int portNum; public Edge (Node a, Node b, int cost, int portNum) { this.start = a; this.end = b; this.cost = cost; this.portNum = portNum; } } In …

  4. Getting Started - GraphStream

    In addition to getNode and getEdge which impose to know the identifier of the node or edge, the graph class provides ways to iterate on the nodes or edges, you can write: for ( Node n: graph …

  5. Graphs in Java - Baeldung

    Jan 17, 2025 · A vertex (or node) represents the entity (e.g., people), and an edge represents the relationship between entities (e.g., a person’s friendships). Let’s define a simple Graph to …

  6. Java Graph Tutorial – How To Implement Graph Data Structure

    Apr 1, 2025 · This Comprehensive Java Graph Tutorial Explains Graph Data Structure in detail. It includes how to Create, Implement, Represent & Traverse Graphs in Java.

  7. Interface Node - GraphStream

    Retrieves an edge between this node and and another node if one exists. This method selects directed or undirected edges. If the edge is directed, its direction is not important and leaving …

  8. Storing, retrieving and displaying data in graphs - GraphStream

    To add a label that will be displayed aside the node or edge on screen, you simply have to set the ui.label attribute on the corresponding Node or Edge. Changing the attribute will automatically …

  9. Graph Data Structure with Java - Java Challengers

    Dec 5, 2022 · The graph data structure is a composition of nodes connected by edges. Graphs are vastly used in the real world. Facebook is an example...

  10. algorithm - Java, connected edges in a directed graph so that the graph ...

    Mar 30, 2014 · I am producing (or trying to) a directed graph in java made up of Node s and Edge s. This graph represents a dependency tree of what I call Modules (Modules play some role in …

Refresh