An Algebra of Graphs and Graph Rewriting