  The mutual consistency of boundary conditions twisted by an automorphism
group G of the chiral algebra is studied for general modular invariants of
rational conformal field theories. We show that a consistent set of twisted
boundary states associated with any modular invariant realizes a non-negative
integer matrix representation (NIM-rep) of the generalized fusion algebra, an
extension of the fusion algebra by representations of the twisted chiral
algebra associated with the automorphism group G. We check this result for
several concrete cases. In particular, we find that two NIM-reps of the fusion
algebra for $su(3)_k (k=3,5)$ are organized into a NIM-rep of the generalized
fusion algebra for the charge-conjugation automorphism of $su(3)_k$. We point
out that the generalized fusion algebra is non-commutative if G is non-abelian
and provide some examples for $G = S_3$. Finally, we give an argument that the
graph fusion algebra associated with simple current extensions coincides with
the generalized fusion algebra for the extended chiral algebra, and thereby
explain that the graph fusion algebra contains the fusion algebra of the
extended theory as a subalgebra.
