- Timestamp:
- Sep 16, 2010, 10:44:40 AM (14 years ago)
- Location:
- src/main/java/weka/clusterers/forMetisMQI/graph
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/weka/clusterers/forMetisMQI/graph/Bisection.java
r10 r11 1 package weka.clusterers.forMetisMQI ;1 package weka.clusterers.forMetisMQI.graph; 2 2 3 3 import java.util.HashSet; … … 6 6 7 7 8 public class KLPartition { 8 9 public class Bisection { 9 10 10 11 private Subgraph a = null; … … 13 14 14 15 private Set<Node> marked = null; 16 17 private UndirectedGraph g = null; 15 18 16 private KLPartition() {19 private Bisection() { 17 20 } 18 21 19 public KLPartition(Subgraph s) { 20 UndirectedGraph g = s.getGraph(); 22 /** 23 * Initialize the bisection with a given subgraph. 24 * @param s 25 */ 26 public Bisection(Subgraph s) { 27 g = s.getGraph(); 21 28 a = s; 22 29 b = new Subgraph(g); … … 30 37 } 31 38 32 public KLPartition(UndirectedGraph g){ 39 /** 40 * Creates a bisection choosing randomly the nodes for each subgraph. 41 * @param g 42 */ 43 public Bisection(UndirectedGraph g){ 44 this.g = g; 33 45 a = new Subgraph(g); 34 46 b = new Subgraph(g); … … 44 56 } 45 57 marked = new HashSet<Node>(); 58 } 59 60 public UndirectedGraph getGraph() { 61 return g; 46 62 } 47 63 … … 106 122 } 107 123 108 public KLPartition copy(){109 KLPartition clone = new KLPartition();124 public Bisection copy(){ 125 Bisection clone = new Bisection(); 110 126 clone.a = (Subgraph) a.clone(); 111 127 clone.b = (Subgraph) b.clone();
Note: See TracChangeset
for help on using the changeset viewer.