sorting. However, its drawback is hash collision,
which occurs when different induced subgraphs have
an identical hash value. Although WSLK must sort
the vertex labels, it has high expressiveness because
each vertex v has a distribution of vertex labels within
i steps from v. To overcome these drawbacks, in this
paper, we propose a novel graph kernel that is equiv-
alent with NHK in terms of time and space complex-
ities and comparable to WLSK in term of expressive-
ness. The graph kernel proposed in this paper is based
on the Hadamard code. The Hadamard code is used in
spread spectrum-based communication technologies
such as Code Division Multiple Access (CDMA) to
spread message signals. Because the probability of
occurrences of 1 and −1 are equivalent in each col-
umn of the Hadamard matrix except for the first col-
umn, labels assigned by our graph kernel follow the
binomial distribution with zero mean under a certain
assumption. Therefore, the expected value of the la-
bel is 0, and for such labels, a large memory space is
not required. This characteristic is used to compress
vertex labels in graphs, enabling the proposed graph
kernel to be computed quickly.
The rest of this paper is organized as follows. In
Section 2, we define the graph classification prob-
lem and explain the framework of the existing graph
kernels. In Section 3, we propose the Hadamard
Code Kernel (HCK), based on the Hadamard code,
and another graph kernel called the Shortened HCK
(SHCK), which is a version of HCK that compresses
vertex labels in graphs. In Section 4, we provide a
theoretical discussion of the effect of overflow on the
proposed graph kernel. In Section 5, the fundamental
performance and practicality of the proposed method
are demonstrated through experiments. Finally, we
conclude the paper in Section 6.
2 GRAPH KERNELS
2.1 Framework of Representative
Graph Kernels
This paper tackles the classification problem of
graphs. A graph is represented as g = (V,E,Σ,ℓ),
where V is a set of vertices, E ⊆ V × V is a set of
edges, Σ is a set of vertex labels, and ℓ : V → Σ is
a function that assigns a label to each vertex in the
graph. Additionally, the set of vertices in graph g
is represented as V(g). Although we assume that
only the vertices in the graphs have labels in this
paper, the methods in this paper can be applied to
graphs where both the vertices and edges have labels.
The vertices adjacent to vertex v are represented as
N(v) = {u | (v,u) ∈ E}. A sequence of vertices from
v to u is called a path, and its step refers to the num-
ber of edges on that path. A path is called simple
if and only if the path does not have repeating ver-
tices. Paths in this paper are not always simple. Given
two graphs g = (V,E,L,ℓ) and g
′
= (V
′
,E
′
,L
′
,ℓ
′
), g
′
is called a subgraph of g, if there exists an injective
function ϕ : V
′
→ V that satisfies the following three
conditions for ∀v, v
1
,v
2
∈ V
′
.
1. (ϕ(v
1
),ϕ(v
2
)) ∈ E, if (v
1
,v
2
) ∈ E
′
,
2. ℓ
′
(v) = ℓ(ϕ(v)),
3. ℓ
′
((v
1
,v
2
)) = ℓ((ϕ(v
1
),ϕ(v
2
))).
Additionally, a subgraph g
′
of g is an “induced sub-
graph,” where ϕ(v
1
) and ϕ(v
2
) are adjacent in g if and
only if v
1
and v
2
in V(g
′
) are adjacent in g
′
.
The graph classification problem is defined as
follows. Given a set of n training examples D =
{(g
i
,y
i
)} (i = 1, · · · , n), where each example is a pair
consisting of a labeled graph g
i
and the class y
i
∈
{+1, −1} to which it belongs, the objective is to learn
a function f that correctly predicts the classes of the
test examples.
In this paper, graphs are classified by a
SVM that uses graph kernels. Let Σ and
c(g,σ) be {σ
1
,σ
2
,··· ,σ
|Σ|
} and c(g,σ) =
|{v ∈ V(g) | ℓ(v) = σ}|, respectively. A function
φ that converts a graph g to a vector is defined as
φ(g) =
c(g,σ
1
),c(g,σ
2
),··· ,c(g,σ
|Σ|
)
T
.
Function k
′
(g
i
,g
j
), defined as φ(g
i
)
T
φ(g
j
), is a semi-
positive definite kernel. This function is calculated as
follows.
k
′
(g
i
,g
j
) = φ(g
i
)
T
φ(g
j
)
=
∑
v
i
∈V(g
i
)
∑
v
j
∈V(g
j
)
δ(ℓ(v
i
),ℓ(v
j
)),
where δ is the Kronecker delta.
Given a g
(h)
= (V,E,Σ,ℓ
(h)
), a procedure to con-
vert g
(h)
to another graph g
(h+1)
= (V,E,Σ
′
,ℓ
(h+1)
)
is called a relabel. Although relabel function ℓ
(h+1)
is defined later in detail, the label of a v in g
(h+1)
is defined using the labels of v and N(v) in g
(h)
,
and is denoted as ℓ
(h+1)
(v) = r(v,N(v),ℓ
(h)
). Let
{g
(0)
,g
(1)
,··· ,g
(h)
} be a series of graphs obtained by
iteratively applying a relabel h times, where g
(0)
is a
graph contained in D. Given two graphs g
i
and g
j
, a
graph kernel is defined using k
′
as
k(g
i
,g
j
) = k
′
(g
(0)
i
,g
(0)
j
) + k
′
(g
(1)
i
,g
(1)
j
) + ··· + k
′
(g
(h)
i
,g
(h)
j
).
Because k is a summation of semi-positive definite
kernels, k is also semi-positive definite (Cristianini
and Taylor, 2000).