From: Joris K. <de...@gm...> - 2013-04-25 15:40:24
|
Dear, Have a look at the hello world example: https://github.com/jgrapht/jgrapht/wiki/HelloWorld There, an undirected graph is created where the vertices are of the type String. Basically what you need to do is the following: 1. Create a new class that models your vertex, e.g.: public class Vertex{ String data; double teta; String status; public Vertex(){ ...Constructor implementation here.... } } Next you create a new undirected weighted graph using your newly created Vertex class as follows: SimpleWeightedGraph<Vertex,DefaultWeightedEdge> myGraph=new SimpleWeightedGraph<Vertex,DefaultWeightedEdge>(DefaultWeightedEdge.class); And then you can start adding vertices/edges, e.g.: myGraph.addVertex(new Vertex()); br, Joris On Wed, Apr 24, 2013 at 7:22 PM, arastoo bozorgi <ara...@ya...> wrote: > Hello > i am new in jgrapht and i have download it 2 days ago. > i want to make an undirect weighted graph with custom vertex structure. > the vertex should have these properties: > 1-string data > 2-double teta > 3-string status > > i dont know how to define these vertex structure in JGrapht and make my > graph with this vertex structure, also i dont know which type of graph > should i use > > please help me > > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > > |