SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ranking System / Ordering Results

    I'm working on a project which i need to work out the best way to ranking/order lists based on a variety of variables. Like some sort of ranking system.

    For example i have a category of websites that are listed in a ranking order based on a score worked out by a variety of variables (i.e date added score, posts count, points earned etc)

    I feel i need some sort of algorithm to acheive this, but i'm not sure where to start of if there is something already out there that i can use.

    The project is built in ASP.NET using generic objects and ms sql database.

    I was looking at something that will work well with generics in ASP.NET.

    At the moment i was thinking of having a table with the website ID in the first column and then all the different variable scores in the following columns and then working out the ranking based on these scores.

    Any one have any ideas of where to start or how to acheive this?

  2. #2
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ja, use the markov chains!
    Non scholae sed vitae discimus.
    http://www.tsubame.de
    http://www.ruynk.de

  3. #3
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Not sure what you are asking, can you clarify. Pretty much all of ASP.NET works well with generics given they are a core language feature.

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What i'm looking at doing is building a simple ranking system, like search engines use, but with alot less factors.

  5. #5
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Ok, well, in a nushell, what you need to create is:

    1) A data structure to capture what data you are tracking
    2) An algorithm to rank this stuff
    3) A way to translate this data into something easily stored/retrieved/queried (aka--put it in a database)
    4) A reporting layer for displaying queried data from #3 to users in a friendly format (aka a website).

    Somewheres in there you need to source data, but that really depends on the system. Sorry for the general answer, but it is a very general question.

    EDIT: if you are thinking something d-i-g-g like, check out either DotNetKicks or Kigg for examples.

  6. #6
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you wwb_99,

    Yeah i'm sorry for the general question, but wasn't sure how to explain my idea.

    Thanks for the liks to those scripts, i'll look into them as see if they are the route i go down.

    And to ask a more specific question, the main thing i want to learn is how to build the algorithm in .net c#.

    Mark

  7. #7
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    If that is the case, I would forget entirely about websites and databases to start with--they are really just a red herring for this sort of thing. Rather, start by building classes that accomplish your mission and use unit tests to run the code. You'll get to "OMG this works" alot quicker.

  8. #8
    SitePoint Enthusiast
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool, Yeah thank you.

    The area i'm looking at the moment is to see if i can do something with generics in c#

    In the Kigg project you mentioned, i notice they have weight and ranks in there classes and i'm stepping through the code at the moment.

    One bit of code i've come across is:

    Code:
               // Now sort it based upon the score
                publishableStories = publishableStories.OrderByDescending(ps => ps.TotalScore).ToList();
    
                // Now assign the Rank
                publishableStories.ForEach(ps => ps.Rank = (publishableStories.IndexOf(ps) + 1));
    Which goes to this method:

    Code:
    public static void ForEach<T>(this IEnumerable<T> enumerable, Action<T> action)
            {
                foreach (T item in enumerable)
                {
                    action(item);
                }
            }
    But at the moment i can't see in what way this is ranking the stories?

    Am i going in the right direction? Looking at looping through the items in the list using the generics method provided by .net?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •