npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nostrank

v0.0.3

Published

nostrank

Downloads

2

Readme



GitHub license npm npm Github Stars

Design

Designing a NostRank style algorithm for a social network requires a graph-based model where nodes represent users and edges represent relationships or interactions between them. The main idea is to distribute the "trust" or "reputation" of a user to its neighbors in the network.

Here's a simplified outline of how you might implement this:

  1. Graph Construction: Construct a graph where each node represents a user and an edge exists between two nodes if there is a relationship or interaction between the two corresponding users. The edge could be weighted based on the strength of the relationship or interaction.

  2. Initial Assignment: Assign each node a preliminary score. For simplicity, you could start with an equal score for every node. For a network with N nodes, this could be 1/N.

  3. Iterations: Perform the iterative NostRank computation. For each node i, distribute its current score across its outgoing edges. The score for each neighboring node j is updated based on the weight of the edge from i to j and the current score of i.

  4. Damping Factor: Implement a damping factor d, typically set to 0.85. This is to account for the fact that not all trust or reputation is passed through interactions. Therefore, each node retains a portion (1 - d) of its score, and only distributes a portion d of its score to its neighbors.

  5. Convergence: Repeat the iterations until the scores converge (i.e., changes between iterations fall below a certain threshold) or a maximum number of iterations is reached.

  6. Normalization: Optionally, normalize scores so they sum to 1 or 100 or another convenient value, for easier interpretation.

This algorithm essentially creates a trust or reputation score for each user in your social network, based on their interactions with other users and the trust or reputation of those users.

A few things to note:

  • It's crucial to carefully consider the nature of relationships and interactions when constructing your graph. For example, you might consider whether mutual interactions should carry more weight than one-way interactions.

  • The NostRank algorithm can be computationally intensive, especially for large graphs. Optimized implementations often use techniques like sparse matrix operations and graph partitioning to improve efficiency.

  • In a social network, new edges (interactions) and nodes (users) are often added over time. You'll need to decide how to handle these updates. You might periodically re-run the entire algorithm, or develop an incremental update approach.

  • Finally, like any reputation or trust score, the output of this algorithm could be sensitive or prone to misuse. It's important to consider privacy and fairness implications, and to communicate clearly to users about how scores are computed and used.

License

  • MIT