|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvertexcover.AbstractVCover
public abstract class AbstractVCover
Constructor Summary | |
---|---|
AbstractVCover()
Creates the object |
Method Summary | |
---|---|
static int[] |
booleans2ints(boolean[] cities)
Converts the boolean array into array of indexes that are true |
abstract int[] |
getMinimalVertexCover(JPFMap map)
Should select minimal number of cities that are necessary to cover all the roads on the map |
static int |
getNumberOfCitiesUsed(boolean[] selectedCities)
Calculates number of true values in the given array |
static int |
getNumberOfRoadsCovered(boolean[] selectedCities,
JPFMap map)
Calculates number of roads covered by cities defined by given array of boolean values (true = city is selected to cover the roads, false = the city is not selected) |
static int |
getNumberOfRoadsCovered(int[] selectedCities,
JPFMap map)
Calculates number of roads covered by cities from given array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractVCover()
Method Detail |
---|
public abstract int[] getMinimalVertexCover(JPFMap map)
public static int getNumberOfRoadsCovered(int[] selectedCities, JPFMap map)
selectedCities
- IDs of cities that cover the roads
public static int getNumberOfRoadsCovered(boolean[] selectedCities, JPFMap map)
selectedCities
- array of cities that cover the roads (true = city
is selected to cover the roads, false = the city is not selected)
public static int getNumberOfCitiesUsed(boolean[] selectedCities)
selectedCities
-
public static int[] booleans2ints(boolean[] cities)
cities
- the arrey to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |