Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

graphology-metrics

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphology-metrics - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

edge/disparity.d.ts

1

edge/index.d.ts

@@ -0,1 +1,2 @@

export {default as disparity} from './disparity';
export {default as simmelianStrength} from './simmelian-strength';

@@ -0,1 +1,2 @@

exports.disparity = require('./disparity.js');
exports.simmelianStrength = require('./simmelian-strength.js');

2

package.json
{
"name": "graphology-metrics",
"version": "2.0.0",
"version": "2.1.0",
"description": "Miscellaneous graph metrics for graphology.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -29,2 +29,3 @@ # Graphology metrics

- [Disparity](#disparity)
- [Simmelian strength](#simmelian-strength)

@@ -287,2 +288,32 @@

### Disparity
Function computing a score for each edge which is necessary to apply a "disparity filter" as described in the following paper:
> Serrano, M. Ángeles, Marián Boguná, and Alessandro Vespignani. "Extracting the multiscale backbone of complex weighted networks." Proceedings of the national academy of sciences 106.16 (2009): 6483-6488.
Note that this metric requires a weighted graph or will return a useless result.
Beware, the results must be interpreted thusly: a lower score means a more relevant edge, as is intuited in the paper's formulae. This means you can prune edges that have a score greater than a given threshold, as a statistical test. Some other implementations might differ in that they offer the opposite intuition (i.e. greater score = more relevant edge).
```js
import disparity from 'graphology-metrics/edge/disparity';
// To compute strength for every edge:
const disparities = disparity(graph);
// To directly map the result onto edge attributes (`disparity`):
disparity.assign(graph);
// Using custom weights
disparity.assign(graph, {getEdgeWeight: (_, attr) => attr.importance});
```
_Arguments_
- **graph** _Graph_: target graph.
- **options** _?object_: options:
- **edgeDisparityAttribute** _?string_ [`disparity`]: Name of the disparity attribute to assign.
- **getEdgeWeight** _?string\|function_ [`weight`]: Name of the edge weight attribute or getter function.
### Simmelian strength

@@ -289,0 +320,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc