What LLBLGen version are you using?
What template system (TDL, lpt)?
BTW, These are the relation types you can use:
Undefined (The relation type is undefined. )
OneToOne (A 1:1 relationship )
OneToMany (A 1:n relationship )
ManyToMany (A m:n relationship )
ManyToOne (A m:1 relationship )
So, if you are using lpt, I think you must check the RelationshipType property of the relation and then you can check the fk fields in the other end (pk or fk, depending) to check the IsOptional property of the FieldElement.