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

isomorphism

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphism - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

14

lib/index.js

@@ -99,6 +99,18 @@ 'use strict';

var setMappingInPossibleMappings = function setMappingInPossibleMappings(possibleMappings, patternVertex, targetVertex) {
var eliminatePossibility = function eliminatePossibility(targetVertex, row) {
return (0, _ramda.filter)(function (possibleTarget) {
return !(possibleTarget === targetVertex);
}, row);
};
var mapping = [];
for (var i = 0; i < possibleMappings.length; i++) {
var possibleMappingsForPatternVertex = possibleMappings[i];
mapping.push(i === patternVertex ? [targetVertex] : possibleMappingsForPatternVertex);
if (i < patternVertex) {
mapping.push(possibleMappingsForPatternVertex);
} else if (i === patternVertex) {
mapping.push([targetVertex]);
} else {
mapping.push(eliminatePossibility(targetVertex, possibleMappingsForPatternVertex));
}
}

@@ -105,0 +117,0 @@ return mapping;

2

package.json
{
"name": "isomorphism",
"version": "0.2.0",
"version": "0.3.0",
"description": "Find subgraph isomorphisms with Ullman's 1976 algorithm.",

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

@@ -44,2 +44,40 @@ /* @flow */

it('Self-reference in target graph does not match three-cycle', function () {
assert.deepEqual(
allIsomorphismsForWeightedDigraphs(
[
[[1,1]],
[[2,1]],
[[0,1]]
],
[
[],
[[1,1]],
[]
],
null
),
[]
)
})
it('Self-reference in target graph does not match three-chain', function () {
assert.deepEqual(
allIsomorphismsForWeightedDigraphs(
[
[[1,1]],
[[2,1]],
[]
],
[
[],
[[1,1]],
[]
],
null
),
[]
)
})
})

@@ -227,2 +265,46 @@

it('Isomorphisms for three-chain pattern on ten-cycle with orphans', function () {
assert.deepEqual(
allIsomorphismsForDigraphs(
[
[1],
[2],
[]
],
[
[],
[2],
[3],
[4],
[5],
[6],
[7],
[8],
[9],
[11],
[],
[1],
[],
[],
[],
[],
[]
],
null
),
[
[1,2,3],
[2,3,4],
[3,4,5],
[4,5,6],
[5,6,7],
[6,7,8],
[7,8,9],
[8,9,11],
[9,11,1],
[11,1,2]
]
)
})
})

Sorry, the diff of this file is not supported yet

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