Relative homological coalgebras