Research: Network Analysis Notebook Workflow
Scope: SNAP datasets, Cypher metrics, pandas/NetworkX bridge, analyst verbs.
Executive summary
Section titled “Executive summary”Notebook network analysis works best when GraphForge owns storage and Cypher, analyst verbs own the common centrality/community algorithms, and NetworkX or igraph are used as optional visualization / oracle layers.
What holds up:
load_dataset(..., "snap-ego-facebook")loads:Node/:CONNECTED_TO— match those labels in Cypher (not invented:Person/:FRIEND_OFaliases)- Degree, triangle, and path queries in openCypher for exploratory metrics
forge.rank/forge.clusterwith optionalwrite_propertyfor persistenceto_networkx()/to_igraph()/to_dataframe()for bridges- Parquet project directories for shareable notebook state
Friction to design around:
- Exported NetworkX node IDs are internal integers unless you pass
node_id_property=...— plan write-back with an explicit id property - Prefer analyst verbs over per-node Cypher UNWIND write-back for large score maps
- Align every snippet’s labels with the dataset schema before debugging the engine
Label alignment
Section titled “Label alignment”from graphforge import GraphForgefrom graphforge.datasets import load_dataset
forge = GraphForge("facebook/")load_dataset(forge, "snap-ego-facebook")
# Dataset schemaforge.execute("MATCH (n) RETURN DISTINCT labels(n) AS labels LIMIT 5")forge.execute("MATCH ()-[r]->() RETURN DISTINCT type(r) AS t")Recommendations
Section titled “Recommendations”- Discover labels once after
load_dataset; never hard-code a different schema. - Use
forge.rank/forge.clusterfor catalog algorithms; see analyst verbs at scale. - Pass
node_id_propertywhen round-tripping algorithm results through NetworkX. - Persist notebooks with
GraphForge("analysis/"), not ad-hoc pickle files.