19package denoptim.graph;
21import static org.junit.jupiter.api.Assertions.assertEquals;
23import java.util.ArrayList;
26import org.junit.jupiter.api.Test;
41 List<Vertex> lst =
new ArrayList<Vertex>();
42 for (
int i=0; i<5; i++)
52 assertEquals(1,r.
indexOf(newV));
56 assertEquals(2,r.
indexOf(newV2));
64 List<Vertex> lst =
new ArrayList<Vertex>();
65 for (
int i=0; i<5; i++)
73 assertEquals(3,r.
getDistance(lst.get(0), lst.get(3)));
74 assertEquals(3,r.
getDistance(lst.get(3), lst.get(0)));
83 List<Vertex> lst =
new ArrayList<Vertex>();
84 for (
int i=0; i<10; i++)
An empty vertex has the behaviors of a vertex, but has no molecular structure.
This class represents the closure of a ring in a spanning tree.
Vertex getCloserToHead(Vertex vA, Vertex vB)
Chooses among the two given vertices the one that is closer to the head vertex.
Vertex getVertexAtPosition(int i)
int getDistance(Vertex v1, Vertex v2)
Measures how many edges there are between two edges along the sequence of vertices that defined this ...
int indexOf(Vertex v)
Returns the index of the first occurrence of the specified element in this ring, or -1 if this list d...
boolean insertVertex(int position, Vertex newLink)
Adds a vertex to the ring, in the given position.
Vertex getCloserTo(Vertex vA, Vertex vB, Vertex vT)
Chooses among the two given vertices the one that is closer to the target vertex.
Vertex getCloserToTail(Vertex vA, Vertex vB)
Chooses among the two given vertices the one that is closer to the tail vertex.
void testGetCloserVertex()
void testUndirectedComparison()
A vertex is a data structure that has an identity and holds a list of AttachmentPoints.
void setBuildingBlockId(int buildingBlockId)