Skip to content
Snippets Groups Projects
Commit b913238a authored by leo's avatar leo
Browse files

Adjazenzliste erstellen

parent 5beb8e6f
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
public class Schulgraph
{
Graph graph;
List<List> list= new List<List>();
public Schulgraph()
{
graph = new Graph();
......@@ -125,6 +126,26 @@ public class Schulgraph
public void deleteNode(Vertex pVertex){
//removeVertex( pVertex);
}
public void returnAdjazenlist(){
List<Vertex> adjazenzliste = new List<Vertex>();
List<Vertex> help2= new List<Vertex>();
adjazenzliste = graph.getVertices();
adjazenzliste.toFirst();
while(!adjazenzliste.isEmpty()&& adjazenzliste.hasAccess()){
Vertex help= adjazenzliste.getContent();
help2 = graph.getNeighbours(help);
if(!help2.isEmpty()){
help2.toFirst();
help2.insert(help);
list.append(help2);
}
adjazenzliste.next();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment