Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Conversation

@mneedham
Copy link
Contributor

No description provided.



List<Node> sourceNodes = configuration.get("sourceNodes", new ArrayList<>());
Stream<Long> sourceNodeIds = sourceNodes.stream().map(Node::getId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use mapToLong to avoid boxing to Long instances

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have updated this now

concurrency,
idMapping.nodeCount(),
dampingFactor,
sourceNodeIds.map(graph::toMappedNodeId).collect(Collectors.toList()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is Huge, we should use toHugeMappedNodeId to get the internal long id.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a Node may not have been mapped if there was any Label/Type filtering, so maybe add a filter(mappedId -> mappedId != -1L) to remove the nodes that we don't know about.

concurrency,
idMapping.nodeCount(),
dampingFactor,
sourceNodeIds.map(graph::toMappedNodeId).collect(Collectors.toList()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use the LongStream here, toArray would probably better.

.toArray();

for (long sourceNodeId : partitionSourceNodeIds) {
partitionRank[Math.toIntExact(sourceNodeId - this.startNode)] = alpha;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knutwalker is this the correct way to find the place in the array to update?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mneedham yes, that's fine; we usually have (int) (nodeId - startNode) for local nodes or (int) (nodeId - starts[partitionIndex]) for nodes in a different partition.

@knutwalker
Copy link
Member

LGTM

@mneedham mneedham merged commit f10151f into neo4j-contrib:3.4 Jul 20, 2018
mneedham added a commit that referenced this pull request Jul 23, 2018
* test showing just normal PageRank

* PPR test WIP

* wip

* more wip

* add calculation to huge as well

* this factory doesn't seem to listen to my undirected suggestion

* Fixing boxing

* fix imports

* fixing a bug in where we set alpha. Offset should be based on our startNode

* filter unmapped nodes

* updating docs to mention PPR

* oops we don't need this
knutwalker added a commit that referenced this pull request Jul 23, 2018
* 3.4:
  Make it more obvious that HugeGraph is reusing cursor state (#671)
  add copyright (#668)
  only load property if it's not null
  same version everywhere
  bump graph algos version
  WIP: Personalized PageRank (#669)

# Conflicts:
#	core/src/main/java/org/neo4j/graphalgo/core/huge/HugeGraphImpl.java
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants