摘要
根据用户随意输入的结点个数以及给定二元关系的关系矩阵,利用矩阵的乘幂运算、加法运算和0,1化处理,求二元关系的传递闭包对应的关系矩阵。使用VB开发工具实现相应的运算,并绘制二元关系及其传递闭包的关系图。VB中未提供直接绘制有向弧的方法,文中采取按弧长比例选点适当偏移的方法画箭头,取得了较为理想的效果。
According to the number of the vertices and the relation matrix of a binary relation given by a user, the relation matrix of transitive closure of a binary relation is found using the power operator, addition operator and 0, 1 transformation. With the help of VB, the relative operator is realized and the relation graph of the binary relation and its transitive closure is drawn. The method for drawing an arc is not provided in VB directly, and therefore the author chooses a point in the line between vertex i and vertex j by definite proportion, and then adopts appropriate offset to draw the arrows with a desirable effect.
出处
《电子科技》
2010年第5期105-106,112,共3页
Electronic Science and Technology
关键词
二元关系
关系的闭包
有向弧
笛卡尔叉积
binary relation
closure of a binary relation
directed graph
Descartes product