Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
GraphTheory[HasArc]
GraphTheory[HasEdge]
Calling Sequence
HasArc(G, e)
HasArc(G, a)
HasEdge(G, e)
HasEdge(G, a)
Parameters
G
-
graph
e
edge - a set of two vertices in G
a
arc (directed edge) - a list of two vertices in G
Description
If e = {u,v} then HasEdge(G,e) returns true if the undirected graph G contains the (undirected) edge {u,v}, and false otherwise.
If a = [u,v], a directed edge, HasEdge(G,a) returns true if the undirected graph G has the undirected edge {u,v} in it.
If a = [u,v], HasArc(G,a) returns true if the directed graph G has the directed edge from vertex u to v in it, and false otherwise.
If e = {u,v}, HasArc(G,a) returns true if the directed graph G has both edges [u,v] and [v,u] in it, and false otherwise.
Because the data structure for a graph is an array of sets of neighbors, the test for edge membership uses binary search and hence the cost is O(log k) where k is the number of neighbors.
Examples
See Also
AddArc, AddEdge, DeleteArc, DeleteEdge, Graph, HighlightEdges
Download Help Document