Skip to content
Novus Examples
graphml916 B

Disconnected Directed Graph - GraphML

A directed graph with two linked islands and one isolated node, designed for weak-component and isolated-node tests. This GraphML member carries the same node IDs, edge IDs, directions and weights as its two format twins.

Preview — first 17 linesgraphml
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
  <key id="label" for="node" attr.name="label" attr.type="string"/>
  <key id="weight" for="edge" attr.name="weight" attr.type="double"/>
  <graph id="disconnected" edgedefault="directed">
    <node id="alpha"><data key="label">alpha</data></node>
    <node id="beta"><data key="label">beta</data></node>
    <node id="gamma"><data key="label">gamma</data></node>
    <node id="delta"><data key="label">delta</data></node>
    <node id="epsilon"><data key="label">epsilon</data></node>
    <node id="zeta"><data key="label">zeta</data></node>
    <edge id="e0" source="alpha" target="beta"><data key="weight">1.0</data></edge>
    <edge id="e1" source="gamma" target="delta"><data key="weight">1.0</data></edge>
    <edge id="e2" source="delta" target="epsilon"><data key="weight">1.0</data></edge>
  </graph>
</graphml>

Specifications

Graph Format
GraphML
Nodes
6
Edges
3
Directed
true
Multigraph
false
Weak Components
3
Contains Cycle
false
Weight Sum
3
Topological Order
alpha -> gamma -> zeta -> beta -> delta -> epsilon

Testing contract

Expected to pass
Scenario
Import the GraphML member and compare graph algorithms and edge identity with the other two representations.
Expected result
Import 6 nodes and 3 edges; preserve 3 weak component(s), cycle=false, weight sum=3.0, topological result=alpha -> gamma -> zeta -> beta -> delta -> epsilon.

What is a .graphml file?

GraphML is an XML-based format for describing graphs — nodes, edges, and typed attributes (keys) on either. It supports directed and undirected graphs, and is widely read by network tools such as Gephi, NetworkX, and yEd. Being plain XML, it is human-readable and easy to transform.

How to use this file

Use an example GraphML file to test graph and network importers, layout tools, and converters between GraphML, GEXF, and adjacency formats, or to verify that node and edge attributes survive a round-trip.

How to use this file for testing

“Disconnected Directed Graph - GraphML” is a deterministic Novus Examples fixture for Graph data, Conversion testing, Data import. Node/edge datasets in GraphML and GEXF (directed and undirected, with attributes and weights) — for testing network importers, layout tools, and graph converters.

Documented properties for this file: 6 nodes · 3 edges. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Data fixtures document their exact quirks — delimiters, encodings, null handling, schema, and row counts — in the spec table. Point your parser or importer at the file and assert it handles the documented edge cases; clean and deliberately-messy siblings make before/after diffs straightforward.

Code examples

import networkx as nx  # pip install networkx

G = nx.read_graphml("disconnected.graphml")
print(G.number_of_nodes(), "nodes", G.number_of_edges(), "edges")

Generated by generation/p6_core.py. Free for any use, no attribution required — license.