Native graph reduces degree when all relationship types are present

I want to execute graph algorithms from the GDS plugin. To do so, a graph projection needs to be defined: Graph Catalog - Neo4j Graph Data Science

However, I noticed that there is a huge difference in the degree distribution (max of 10k) when only using (A) (= only Friends) but the max is down to 5 when using all the relations present in (B).

This seems strange to me - I would have expected that the max degree can only increase when more diverse types of relationships are made available to the GDS graph.


CALL gds.graph.drop('my_graph') YIELD graphName;

// A: only Friend
CALL gds.graph.create.cypher(
    'my_graph',
    'MATCH (n) RETURN id(n) AS id',
    'MATCH (a)-[r:Friend]->(b) RETURN id(a) AS source, id(b) AS target'
);

// B: everything
CALL gds.graph.create.cypher(
    'my_graph',
    'MATCH (n) RETURN id(n) AS id',
    'MATCH (a)-[r]->(b) RETURN id(a) AS source, id(b) AS target'
);
CALL gds.graph.list();

You'll want to look at relationship aggregation parameters: https://neo4j.com/docs/graph-data-science/current/management-ops/cypher-projection/#cypher-projection-relationship-aggregation


My suspicion is that, while the degree is higher, the number of nodes is lower for the Friend projection. I assume you're using percentiles vs maximum?

I was looking at the output for: CALL gds.graph.list(); and there at the max degree attribute. This attribute decreased drastically when adding more relationships - and I still do not understand why.