title: LEM2 algorithm implementation in C#
body: <p>I'm new on StackOverflow and this is my first question.
  I have problem with part of LEM2 algorithm. I have something like that:</p>
  
  <pre><code>public class Rule {
          String atribute { get; set;}
          String value { get; set;}
  
          public Rule(){}
  
          public Rule(String atribute, String value){
              this.atribute = atribute;
              this.value = value;
          }
      }
  
  public class RuleObject {
          Rule rule { get; set; }
          List&lt;int&gt; indexList { get; set; }
  
          public RuleObject(){}
  
          public RuleObject (Rule rule, List&lt;int&gt; indexList){
              this.rule = rule;
              this.indexList = indexList;
          }
      }
  
  public static void Main (string[] args){
              List&lt;int&gt; G = new List&lt;int&gt; (){ 1, 2, 4, 5, 7 };
              List&lt;RuleObject&gt; ruleObjectList = new List&lt;RuleObject&gt; ();
  
              ruleObjectList.Add (new RuleObject (new Rule ("inflation", "decrease"), new List&lt;int&gt; (){1,2,7}));
              ruleObjectList.Add (new RuleObject (new Rule ("inflation", "no_change"), new List&lt;int&gt; (){3,4,5,6,8}));
              ruleObjectList.Add (new RuleObject (new Rule ("budget", "no_change"), new List&lt;int&gt; (){1,5,8}));
              ruleObjectList.Add (new RuleObject (new Rule ("budget", "increase"), new List&lt;int&gt; (){2,3,4,6,7}));
              ruleObjectList.Add (new RuleObject (new Rule ("reserve", "increase"), new List&lt;int&gt; (){1,3,7,8}));
              ruleObjectList.Add (new RuleObject (new Rule ("reserve", "decrease"), new List&lt;int&gt; (){2,4,5}));
          }
  </code></pre>
  
  <p>And i have to do:</p>
  
  <ol>
  <li>Select a rule that indexList cover maximum values from G. </li>
  <li>If a tie occurs, select a rule  with minimum values outside G. </li>
  <li>If another tie occurs, select first pair.</li>
  </ol>
  
  <p>Example:</p>
  
  <ol>
  <li>Inflation-decrease &amp; budget-increase &amp; reserve-decrease covers 3 rules from G.</li>
  <li>From those 3 rules we choose inflation-decrease &amp; reserve-decrease.</li>
  <li>In result we select rule inflation-decrease.</li>
  </ol>
  
  <p>Any suggestion how to do that ?</p>