Class ShiftedByOneArcListASCIIGraph

All Implemented Interfaces:
FlyweightPrototype<ImmutableGraph>

public final class ShiftedByOneArcListASCIIGraph
extends ArcListASCIIGraph
An ArcListASCIIGraph with fixed shift -1. Very useful to read graphs specified as pairs of arcs with node numbering starting from one.

Using ArcListASCIIGraph with MatLab-like sparse matrix files

The main intended usage of this class is that of interfacing easily with MatLab-like sparse matrix files. Note that for this to happen it is necessary to shift by one all indices. Assume you have a file named example.arcs:

  1 2
  2 3
  3 2
  
Then, the command
  java it.unimi.dsi.webgraph.BVGraph -1 -g ShiftedByOneArcListASCIIGraph dummy bvexample <example.arcs
  
will generate a BVGraph as expected (e.g, there is an arc from 0 to 1).