si/eecs 767 yang liu apr 2, 2010. a minimum cut is the smallest cut that will disconnect a graph...

54
MINCUTS SI/EECS 767 Yang Liu Apr 2, 2010

Upload: solomon-liverpool

Post on 14-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

MINCUTS

SI/EECS 767Yang LiuApr 2, 2010

Page 2: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

INTRODUCTION

A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.

Application: Graph partitioning Data clustering Graph-based machine learning

Page 3: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

BACKGROUND KNOWLEDGE

Cut A cut C = (S,T) is a partition of V of a graph G =

(V, E). An s-t cut C = (S,T) of a network N = (V, E) is a cut

of N such that s∈S and t∈T, where s and t are the source and the sink of N respectively.

The cut-set of a cut C = (S,T) is the set {(u,v)∈E | u∈S, v∈T}.

The size of a cut C = (S,T) is the number of edges in the cut-set. If the edges are weighted, the value of the cut is the sum of the weights.

(http://en.wikipedia.org/wiki/Cut_(graph_theory))

Page 4: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

BACKGROUND KNOWLEDGE

Minimum cut A cut is minimum if the size of the cut is not larger

than the size of any other cut.

Max-flow-min-cut theorem The maximum flow between two vertices is always equal

to the size of the minimum cut times the capacity of a single pipe.

Also applies to weighted networks in which individual pipes can have different capacities.

Page 5: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

BACKGROUND KNOWLEDGE

Max-flow min-cut theorem is very useful because there are simple computer algorithms that can calculate maximum flows quite quickly (in polynomial time) for any given networks.

We can use these same algorithms to quickly calculate the size of a cut set.

Page 6: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

THE AUGMENTING PATH ALGORITHM

Basic idea: First find a path from source s to sink t

using the breadth-first search; Then find another path from s to t among

the remaining edges and repeat this procedure until no more paths can be found.

s t

Page 7: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

A SIMPLE FIX

Allow fluid to flow simultaneously both ways down an edge in the network.

Mark Newman’s text book (preprint version)

Page 8: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Graph Clustering and Minimum Cut Tress

(Flake et al 2004)

Page 9: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

INTRODUCTION

Clustering data into disjoint groups Data sets can be represented as

weighted graphs Nodes = entities to be clustered Edges = a similarity measure between

entities Present a new clustering algorithm

based on maximum flow. (in particular minimum cut tree)

Page 10: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

MINIMUM CUT TREE

Also known as Gomory–Hu tree A weighted tree that consists of edges

representing all pairs minimum s-t cut in the graph

For every undirected graph, there always exists a min-cut tree.

See [Gomory and Hu 61] for detail and the algorithm for calculating min-cut trees.

Page 11: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

CUT CLUSTERING ALGORITHM

Page 12: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

CHOOSING

α→0, the trivial cut ({t}, V) α→∞, n trivial clusters, all singletons The exact value of α depends on the structure

of G and the distribution of the weights over the edges.

The algorithm finds all clusters either in increasing or decreasing order, we can stop the algorithm as soon as a desired cluster has been found.

α

Page 13: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

HIERARCHICAL CUT-CLUSTERING ALGORITHM

Once a clustering is produced, contract the clusters into single nodes and apply the same algorithm to the resulting graph.

When contracting a set of nodes, they get replaced by a single new node; possible loops get deleted and parallel edges are combined into a single edge with weight equal to the sum of their weights.

break if ((clusters returned are of desired number and size)

or (clustering failed to create nontrivial clusters))

Page 14: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning
Page 15: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

EXPERIMENTAL RESULTS

CiteSeer Citation network (documents as nodes,

citations as edges)Low level high level

Page 16: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

CONCLUSION

Minimum cut trees, based on expanded graphs, provide a means for producing quality clusterings and for extracting heavily connected components.

A single parameter, α, can be used as a strict bound on the expansion of the clustering while simultaneously serving to bound the intercluster weight as well.

Page 17: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Bipartite Graph Partitioning and Data Clustering

(Zha et al 2001)

Page 18: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

INTRODUCTION

Bipartite graph Two kinds of vertices One representing the original vertices and the

other representing the groups to which they belong

Examples: terms and documents, authors and authors of an article

Adapt undirected graphs criteria for bipartite graph partitioning and therefore solve the bi-clustering problem.

Page 19: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

BIPARTITE GRAPH PARTITIONING

Bipartite graph G(X, Y, W) In the context of document clustering

X represents the set of terms Y represents the set of documents W = (wij) represents term frequency of i in

document j.

Page 20: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Tends to produce unbalanced clusters

The problem becomes following optimization problem

Page 21: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Computational complexity: general linear in the number of documents to be clustered

Page 22: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

EXPERIMENTS

20 news groups

Page 23: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Learning from Labeled and Unlabeled Data using

Graph Mincuts

(Blum & Chawla 2001)

Page 24: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

INTRODUCTION

Many application domains suffer from not having enough labeled training data for learning.

Large amounts of unlabeled examples How unlabeled data can be used to aid

classification

Page 25: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

THE GRAPH MINCUT LEARNING ALGORITHM

A set L of labeled examples A set U of unlabeled examples Binary classification

L+ to denote the set of positive examples L- to denote the set of negtive examples

Page 26: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Construct a weighted graph G = (V, E), where V = L∪U∪{v+, v-}, e ∈ E is a weight w(e).

v+, v-: classification vertices;

other vertices: example vertices; w(v, v+) = ∞ for all v ∈L+ and w(v, v-) = ∞ for all

v ∈L- The edge between example vertices are

assigned weights based on some relationship (similarity/distance) between the examples

Page 27: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Determine a minimum (v+, v-) cut for the graph, i.e. the minimum total weight set of edges whose removal disconnects v+ and v-. (using a max-flow algorithm in which v+ is the source, v- is the sink)

Assign a positive label to all unlabeled examples in the set V+ and a negative label to all unlabeled examples in the set V-.

*edges between examples which are similar to each other should be given a high weight

Page 28: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

POTENTIAL PROBLEM

If there are few labeled examples, it can cause mincut to assign the unlabeled examples to one class or the other

If the graph is too sparse, it could have a number of disconnected components

Therefore it is important to use a proper weighting function

Page 29: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

EXPERIMENTAL ANALYSIS

Datasets: UCI, 2000 The mincut algorithm has many degrees of freedom

in terms of how the edge weights are defined. Mincut-3: each example is connected to its nearest

labeled example and two other nearest examples overall Mincut- δ: if too nodes are closer than δ , they are

connected Mincut- δ0: max δ which graph has a cut of value 0 Mincut- δ1/2: the size of the largest connected component in

the graph is half the number of datapoints Mincut- δopt: the values of δ that corresponds to the least

classification error in hindsight

Page 30: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning
Page 31: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

REVIEW

The basic idea of this algorithm is to build a graph on all the data with edges between examples that are sufficiently similar

then to partition the graph into a positive and a negative set in a way that (a) agrees with the labeled data (b) cuts as few edges as possible

Page 32: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Semi-supervised Learning using Randomized

Mincuts

(Blum et al 2004)

Page 33: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

INTRODUCTION

The drawbacks of the graph mincut approach: A graph may have many minimum cuts and

the mincut algorithm produces just one, typically the “leftmost” one using standard network flow algorithms.

Produced based on joint labeling rather than per-node probabilities.

Can be improved by averaging over many small cuts.

Page 34: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

BASIC IDEA

Repeatedly add artificial random noise to the edge weights

Solve for the minimum cut in the resulting graphs

Output a fractional label for each example corresponding to the fraction of the time it was on one side or the other

Page 35: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

RANDOMIZED MINCUTS WITH SANITY CHECK

Given a graph G, produce a collection of cuts by repeatedly adding random noise to the edge weights and then solving for the minimum cut in the perturbed graph.

Sanity check: remove those that are highly unbalanced (any cut with less than 5% of the vertices on one side in this paper)

Predict based on a majority vote

Page 36: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

EXAMPLE

Overcome some of the limitations of the plain mincut algorithm.

Consider a graph which simply consists of a line with a positively labeled node at one end and a negatively labeled node at the other end with the rest being unlabeled. Plain mincut: the cut will be the leftmost or right

most one Randomized mincut: end up using the middle of

the line with confidence that increases linearly out to the endpoints

Page 37: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

UNIFORM DISTRIBUTION OF MINIMUM CUTS

Page 38: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

GRAPH DESIGN CRITERIA

The graph should be either be connected or at least have the property that a small number of connected components cover nearly all the examples.

Good to create a graph that at least has some small balanced cuts.

Page 39: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

TWO GRAPH CONSTRUCTION METHODS MST: simply construct a minimum

spanning tree on the entire dataset δ-MST: connect two points with an edge

if they are within a radius δ. Then veiw the components produced as super nodes and connect them via an MST.

Page 40: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

EXPERIMENTAL ANALYSIS

Handwritten digits 20 newsgroups Various UCI datasets

Page 41: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning
Page 42: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

CONCLUSTION

Improve performance when the number of labeled examples is small

Providing a confidence score for accuracy-coverage curves.

Page 43: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

A Sentimental Education: Sentiment Analysis using

Subjectivity Summarization based on

Minimum Cuts

(Pang & Lee 2004)

Page 44: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

INTRODUCTION

machine-learning method that applies text-categorization techniques to determine the sentiment polarity—positive (“thumbs up”) or negative (“thumbs down”)

Page 45: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Previous approaches focused on selecting indicative lexical features

Their approach: Label the sentences as either subjective or

objective Apply a standard machine-learning

classifier to the resulting extract.

Page 46: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

METHODS

Page 47: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

SUBJECTIVITY DETECTION

n items x1, . . . , xn to divide into two classes C1 and C2

• Individual scores indj(xi): non-negative estimates of each xi’s preference for being in Cj based on just the features of xi alone;

• Association scores assoc(xi, xk): non-negative estimates of how important it is that xi and xk be in the same class.

Minimize the partition cost

:

Page 48: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Build an undirected graph G with vertices {v1, . . . , vn, s, t}; the last two are, respectively, the source and sink.

Add n edges (s, vi), each with weight ind1(xi), and n edges (vi, t), each with weight ind2(xi).

Finally, add edges (vi, vk), each with weight assoc(xi, xk).

Page 49: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning
Page 50: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

EVALUATION FRAMEWORK

Classifying movie reviews as either positive and negative

The correct label can be extracted automatically from rating information (number of stars)

Page 51: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

CONSTRUCTION OF THE GRAPH

The source s and sink t correspond to the class of subjective and objective sentences

Each internal node vi corresponds to the document’s ith sentence si

Set the ind1(si) to : Naive Bayes’ estimate of the

probability that sentence s is subjective

Page 52: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

EXPERIMENTAL RESUTLS

NB as a subjectivity detector in conjunction with a NB document-level polarity 86.4% accuracy VS 82.8% without extraction

SVM: 87.15% VS 86.4% Sentences labeled as objective as input: 71% for NB and 67% for SVMs Taking just the N most subjective sentences:

5 most subjective sentences is almost as informative as the Full review while containing only about 22% of the source words.

Page 53: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

CONCLUSION

Subjectivity detection can compress reviews into shorter extracts still retain polarity information

Minimum-cut frame work results in the development of efficient algorithm for sentiment analysis

Page 54: SI/EECS 767 Yang Liu Apr 2, 2010.  A minimum cut is the smallest cut that will disconnect a graph into two disjoint subsets.  Application:  Graph partitioning

Questions?