Ignore:
Timestamp:
Sep 16, 2010, 10:44:40 AM (14 years ago)
Author:
gnappo
Message:

Un po' di refactoring e implementazione dell'algoritmo di raffinamento.

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;
     1package weka.clusterers.forMetisMQI.graph;
    22
    33import java.util.HashSet;
     
    66
    77
    8 public class KLPartition {
     8
     9public class Bisection {
    910       
    1011        private Subgraph a = null;
     
    1314       
    1415        private Set<Node> marked = null;
     16       
     17        private UndirectedGraph g = null;
    1518
    16         private KLPartition() {
     19        private Bisection() {
    1720        }
    1821       
    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();
    2128                a = s;
    2229                b = new Subgraph(g);
     
    3037        }
    3138       
    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;
    3345                a = new Subgraph(g);
    3446                b = new Subgraph(g);
     
    4456                }
    4557                marked = new HashSet<Node>();
     58        }
     59       
     60        public UndirectedGraph getGraph() {
     61                return g;
    4662        }
    4763       
     
    106122        }
    107123       
    108         public KLPartition copy(){
    109                 KLPartition clone = new KLPartition();
     124        public Bisection copy(){
     125                Bisection clone = new Bisection();
    110126                clone.a = (Subgraph) a.clone();
    111127                clone.b = (Subgraph) b.clone();
Note: See TracChangeset for help on using the changeset viewer.