fbpx
Wikipedia

Weighted matroid

In combinatorics, a branch of mathematics, a weighted matroid is a matroid endowed with a function that assigns a weight to each element. Formally, let be a matroid, where E is the set of elements and I is the family of independent set. A weighted matroid has a weight function for assigns a strictly positive weight to each element of . We extend the function to subsets of by summation; is the sum of over in .

Finding a maximum-weight independent set edit

A basic problem regarding weighted matroids is to find an independent set with a maximum total weight. This problem can be solved using the following simple greedy algorithm:

  • Initialize the set A to an empty set. Note that, by definition of a matroid, A is an independent set.
  • For each element x in E\A, check whether Au{x} is still an independent set.
    • If there are no such elements, then stop, as A cannot be extended anymore.
    • If there is at least one such element, then choose the one with maximum weight, and add it to A.

This algorithm does not need to know anything about the matroid structure; it just needs an independence oracle for the matroid - a subroutine for testing whether a set is independent.

Jack Edmonds[1] proved that this simple algorithm indeed finds an independent set with maximum weight. Denote the set found by the algorithm by e1,...,ek. By the matroid properties, it is clear that k=rank(M), otherwise the set could be extended. Assume by contradiction that there is another set with a higher weight. Without loss of generality, it is possible to assume that this set has rank(M) elements too; denote it by f1,...,fk. Order these items such that w(f1) ≥ ... ≥ w(fk). Let j be the first index for which w(fj) > w(ej). Apply the augmentation property to the sets {f1,...,fj} and {e1,...,ej-1}; we conclude that there must be some i ≤ j such that fi could be added to {e1,...,ej-1} while keeping it independent. But w(fi) ≥ w(fj) > w(ej), so fi should have been chosen in step j instead of ej - a contradiction.[2]: 212 

Example: spanning forest algorithms edit

As a simple example, say we wish to find the maximum spanning forest of a graph. That is, given a graph and a weight for each edge, find a forest containing every vertex and maximizing the total weight of the edges in the tree. This problem arises in some clustering applications. It can be solved by Kruskal's algorithm, which can be seen as the special case of the above greedy algorithm to a graphical matroid.

If we look at the definition of the forest matroid, we see that the maximum spanning forest is simply the independent set with largest total weight — such a set must span the graph, for otherwise we can add edges without creating cycles. But how do we find it?

Finding a basis edit

There is a simple algorithm for finding a basis:

  • Initially let   be the empty set.
  • For each   in  
    • if   is independent, then set   to  .

The result is clearly an independent set. It is a maximal independent set because if   is not independent for some subset   of  , then   is not independent either (the contrapositive follows from the hereditary property). Thus if we pass up an element, we'll never have an opportunity to use it later. We will generalize this algorithm to solve a harder problem.

Extension to optimal edit

An independent set of largest total weight is called an optimal set. Optimal sets are always bases, because if an edge can be added, it should be; this only increases the total weight. As it turns out, there is a trivial greedy algorithm for computing an optimal set of a weighted matroid. It works as follows:

  • Initially let   be the empty set.
  • For each   in  , taken in (monotonically) decreasing order by weight
    • if   is independent, then set   to  .

This algorithm finds a basis, since it is a special case of the above algorithm. It always chooses the element of largest weight that it can while preserving independence (thus the term "greedy"). This always produces an optimal set: suppose that it produces   and that  . Now for any   with  , consider open sets   and  . Since   is smaller than  , there is some element of   which can be put into   with the result still being independent. However   is an element of maximal weight that can be added to   to maintain independence. Thus   is of no smaller weight than some element of  , and hence   is of at least a large a weight as  . As this is true for all  ,   is weightier than  .

Complexity analysis edit

The easiest way to traverse the members of   in the desired order is to sort them. This requires   time using a comparison sorting algorithm. We also need to test for each   whether   is independent; assuming independence tests require   time, the total time for the algorithm is  .

If we want to find a minimum spanning tree instead, we simply "invert" the weight function by subtracting it from a large constant. More specifically, let  , where   exceeds the total weight over all graph edges. Many more optimization problems about all sorts of matroids and weight functions can be solved in this trivial way, although in many cases more efficient algorithms can be found that exploit more specialized properties.

Matroid requirement edit

Note also that if we take a set   of "independent" sets which is a down-set but not a matroid, then the greedy algorithm will not always work. For then there are independent sets   and   with  , but such that for no   is   independent.

Pick an   and   such that  . Weight the elements of   in the range   to  , the elements of   in the range   to  , the elements of   in the range   to  , and the rest in the range   to  . The greedy algorithm will select the elements of  , and then cannot pick any elements of  . Therefore, the independent set it constructs will be of weight at most  , which is smaller than the weight of  .

Characterization edit

This optimization algorithm may be used to characterize matroids: if a family F of sets, closed under taking subsets, has the property that, no matter how the sets are weighted, the greedy algorithm finds a maximum-weight set in the family, then F must be the family of independent sets of a matroid.[3]

Generalizations edit

The notion of matroid has been generalized to allow for other types of sets on which a greedy algorithm gives optimal solutions; see greedoid and matroid embedding for more information. Korte and Lovász would generalize these ideas to objects called greedoids, which allow even larger classes of problems to be solved by greedy algorithms.

References edit

  1. ^ Edmonds, Jack (1971-12-01). "Matroids and the greedy algorithm". Mathematical Programming. 1 (1): 127–136. doi:10.1007/BF01584082. ISSN 1436-4646.
  2. ^ Grötschel, Martin; Lovász, László; Schrijver, Alexander (1993), Geometric algorithms and combinatorial optimization, Algorithms and Combinatorics, vol. 2 (2nd ed.), Springer-Verlag, Berlin, doi:10.1007/978-3-642-78240-4, ISBN 978-3-642-78242-8, MR 1261419
  3. ^ Oxley (1992), p. 64
  • Jack Edmonds. Matroids and the Greedy Algorithm. Mathematical Programming, volume 1, p. 125–136. 1971.

weighted, matroid, combinatorics, branch, mathematics, weighted, matroid, matroid, endowed, with, function, that, assigns, weight, each, element, formally, displaystyle, matroid, where, elements, family, independent, weighted, matroid, weight, function, displa. In combinatorics a branch of mathematics a weighted matroid is a matroid endowed with a function that assigns a weight to each element Formally let M E I displaystyle M E I be a matroid where E is the set of elements and I is the family of independent set A weighted matroid has a weight function w E R displaystyle w E rightarrow mathbb R for assigns a strictly positive weight to each element of E displaystyle E We extend the function to subsets of E displaystyle E by summation w A displaystyle w A is the sum of w x displaystyle w x over x displaystyle x in A displaystyle A Contents 1 Finding a maximum weight independent set 2 Example spanning forest algorithms 2 1 Finding a basis 2 2 Extension to optimal 2 3 Complexity analysis 2 4 Matroid requirement 3 Characterization 4 Generalizations 5 ReferencesFinding a maximum weight independent set editA basic problem regarding weighted matroids is to find an independent set with a maximum total weight This problem can be solved using the following simple greedy algorithm Initialize the set A to an empty set Note that by definition of a matroid A is an independent set For each element x in E A check whether Au x is still an independent set If there are no such elements then stop as A cannot be extended anymore If there is at least one such element then choose the one with maximum weight and add it to A This algorithm does not need to know anything about the matroid structure it just needs an independence oracle for the matroid a subroutine for testing whether a set is independent Jack Edmonds 1 proved that this simple algorithm indeed finds an independent set with maximum weight Denote the set found by the algorithm by e1 ek By the matroid properties it is clear that k rank M otherwise the set could be extended Assume by contradiction that there is another set with a higher weight Without loss of generality it is possible to assume that this set has rank M elements too denote it by f1 fk Order these items such that w f1 w fk Let j be the first index for which w fj gt w ej Apply the augmentation property to the sets f1 fj and e1 ej 1 we conclude that there must be some i j such that fi could be added to e1 ej 1 while keeping it independent But w fi w fj gt w ej so fi should have been chosen in step j instead of ej a contradiction 2 212 Example spanning forest algorithms editAs a simple example say we wish to find the maximum spanning forest of a graph That is given a graph and a weight for each edge find a forest containing every vertex and maximizing the total weight of the edges in the tree This problem arises in some clustering applications It can be solved by Kruskal s algorithm which can be seen as the special case of the above greedy algorithm to a graphical matroid If we look at the definition of the forest matroid we see that the maximum spanning forest is simply the independent set with largest total weight such a set must span the graph for otherwise we can add edges without creating cycles But how do we find it Finding a basis edit There is a simple algorithm for finding a basis Initially let A displaystyle A nbsp be the empty set For each x displaystyle x nbsp in E displaystyle E nbsp if A x displaystyle A cup x nbsp is independent then set A displaystyle A nbsp to A x displaystyle A cup x nbsp The result is clearly an independent set It is a maximal independent set because if B x displaystyle B cup x nbsp is not independent for some subset B displaystyle B nbsp of A displaystyle A nbsp then A x displaystyle A cup x nbsp is not independent either the contrapositive follows from the hereditary property Thus if we pass up an element we ll never have an opportunity to use it later We will generalize this algorithm to solve a harder problem Extension to optimal edit An independent set of largest total weight is called an optimal set Optimal sets are always bases because if an edge can be added it should be this only increases the total weight As it turns out there is a trivial greedy algorithm for computing an optimal set of a weighted matroid It works as follows Initially let A displaystyle A nbsp be the empty set For each x displaystyle x nbsp in E displaystyle E nbsp taken in monotonically decreasing order by weight if A x displaystyle A cup x nbsp is independent then set A displaystyle A nbsp to A x displaystyle A cup x nbsp This algorithm finds a basis since it is a special case of the above algorithm It always chooses the element of largest weight that it can while preserving independence thus the term greedy This always produces an optimal set suppose that it produces A e1 e2 er displaystyle A e 1 e 2 ldots e r nbsp and that B f1 f2 fr displaystyle B f 1 f 2 ldots f r nbsp Now for any k displaystyle k nbsp with 1 k r displaystyle 1 leq k leq r nbsp consider open sets O1 e1 ek 1 displaystyle O 1 e 1 ldots e k 1 nbsp and O2 f1 fk displaystyle O 2 f 1 ldots f k nbsp Since O1 displaystyle O 1 nbsp is smaller than O2 displaystyle O 2 nbsp there is some element of O2 displaystyle O 2 nbsp which can be put into O1 displaystyle O 1 nbsp with the result still being independent However ek displaystyle e k nbsp is an element of maximal weight that can be added to O1 displaystyle O 1 nbsp to maintain independence Thus ek displaystyle e k nbsp is of no smaller weight than some element of O2 displaystyle O 2 nbsp and hence ek displaystyle e k nbsp is of at least a large a weight as fk displaystyle f k nbsp As this is true for all k displaystyle k nbsp A displaystyle A nbsp is weightier than B displaystyle B nbsp Complexity analysis edit The easiest way to traverse the members of E displaystyle E nbsp in the desired order is to sort them This requires O E log E displaystyle O E log E nbsp time using a comparison sorting algorithm We also need to test for each x displaystyle x nbsp whether A x displaystyle A cup x nbsp is independent assuming independence tests require O f E displaystyle O f E nbsp time the total time for the algorithm is O E log E E f E displaystyle O E log E E f E nbsp If we want to find a minimum spanning tree instead we simply invert the weight function by subtracting it from a large constant More specifically let wmin x W w x displaystyle w text min x W w x nbsp where W displaystyle W nbsp exceeds the total weight over all graph edges Many more optimization problems about all sorts of matroids and weight functions can be solved in this trivial way although in many cases more efficient algorithms can be found that exploit more specialized properties Matroid requirement edit Note also that if we take a set I displaystyle I nbsp of independent sets which is a down set but not a matroid then the greedy algorithm will not always work For then there are independent sets I1 displaystyle I 1 nbsp and I2 displaystyle I 2 nbsp with I1 lt I2 displaystyle I 1 lt I 2 nbsp but such that for no e I2 I1 displaystyle e in I 2 setminus I 1 nbsp is I1 e displaystyle I 1 cup e nbsp independent Pick an ϵ gt 0 displaystyle epsilon gt 0 nbsp and t gt 0 displaystyle tau gt 0 nbsp such that 1 2ϵ I1 t E lt I2 displaystyle 1 2 epsilon I 1 tau E lt I 2 nbsp Weight the elements of I1 I2 displaystyle I 1 cup I 2 nbsp in the range 2 displaystyle 2 nbsp to 2 2ϵ displaystyle 2 2 epsilon nbsp the elements of I1 I2 displaystyle I 1 setminus I 2 nbsp in the range 1 ϵ displaystyle 1 epsilon nbsp to 1 2ϵ displaystyle 1 2 epsilon nbsp the elements of I2 I1 displaystyle I 2 setminus I 1 nbsp in the range 1 displaystyle 1 nbsp to 1 ϵ displaystyle 1 epsilon nbsp and the rest in the range 0 displaystyle 0 nbsp to t displaystyle tau nbsp The greedy algorithm will select the elements of I1 displaystyle I 1 nbsp and then cannot pick any elements of I2 I1 displaystyle I 2 setminus I 1 nbsp Therefore the independent set it constructs will be of weight at most 1 2ϵ I1 t E I1 I2 displaystyle 1 2 epsilon I 1 tau E I 1 cup I 2 nbsp which is smaller than the weight of I2 displaystyle I 2 nbsp Characterization editThis optimization algorithm may be used to characterize matroids if a family F of sets closed under taking subsets has the property that no matter how the sets are weighted the greedy algorithm finds a maximum weight set in the family then F must be the family of independent sets of a matroid 3 Generalizations editThe notion of matroid has been generalized to allow for other types of sets on which a greedy algorithm gives optimal solutions see greedoid and matroid embedding for more information Korte and Lovasz would generalize these ideas to objects called greedoids which allow even larger classes of problems to be solved by greedy algorithms References edit Edmonds Jack 1971 12 01 Matroids and the greedy algorithm Mathematical Programming 1 1 127 136 doi 10 1007 BF01584082 ISSN 1436 4646 Grotschel Martin Lovasz Laszlo Schrijver Alexander 1993 Geometric algorithms and combinatorial optimization Algorithms and Combinatorics vol 2 2nd ed Springer Verlag Berlin doi 10 1007 978 3 642 78240 4 ISBN 978 3 642 78242 8 MR 1261419 Oxley 1992 p 64harvp error no target CITEREFOxley1992 help Jack Edmonds Matroids and the Greedy Algorithm Mathematical Programming volume 1 p 125 136 1971 Retrieved from https en wikipedia org w index php title Weighted matroid amp oldid 1203296726, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.