1 %feature("docstring") gum::MixedGraph 2 " 3 MixedGraph represents a graph with both arcs and edges. 4 5 MixedGraph() -> MixedGraph 6 default constructor 7 8 MixedGraph(src) -> MixedGraph 9 Parameters: 10 * **src** (*pyAgrum.MixedGraph*) --the MixedGraph to copy 11 " 12 %feature("docstring") gum::MixedGraph::addArc 13 " 14 Add an arc from tail to head. 15 16 Parameters 17 ---------- 18 tail : int 19 the id of the tail node 20 head : int 21 the id of the head node 22 23 Raises 24 ------ 25 pyAgrum.InvalidNode 26 If head or tail does not belong to the graph nodes. 27 " 28 29 %feature("docstring") gum::MixedGraph::addNode 30 " 31 Returns 32 ------- 33 int 34 the new NodeId 35 " 36 37 %feature("docstring") gum::MixedGraph::mixedOrientedPath 38 " 39 Parameters 40 ---------- 41 node1 : int 42 the id form which the path begins 43 node2 : int 44 the id to witch the path ends 45 46 Returns 47 ------- 48 List 49 a path from node1 to node2, using edges and/or arcs (following the direction of the arcs). If no path is found, the returned list is empty. 50 " 51 52 %feature("docstring") gum::MixedGraph::mixedUnorientedPath 53 " 54 Parameters 55 ---------- 56 node1 : int 57 the id from which the path begins 58 node2 : int 59 the id to which the path ends 60 61 Returns 62 ------- 63 List 64 a path from node1 to node2, using edges and/or arcs (not necessarily following the direction of the arcs). If no path is found, the list is empty. 65 66 " 67 68 69 %feature("docstring") gum::MixedGraph::addEdge 70 " 71 Insert a new edge into the graph. 72 73 Parameters 74 ---------- 75 n1 : int 76 the id of one node of the new inserted edge 77 n2 : int 78 the id of the other node of the new inserted edge 79 80 Raises 81 ------ 82 pyAgrum.InvalidNode 83 If n1 or n2 does not belong to the graph nodes. 84 " 85 86 %feature("docstring") gum::MixedGraph::addNodeWithId 87 " 88 Add a node by choosing a new NodeId. 89 90 Parameters 91 ---------- 92 id : int 93 The id of the new node 94 95 Raises 96 ------ 97 pyAgrum.DuplicateElement 98 If the given id is already used 99 " 100 101 %feature("docstring") gum::MixedGraph::addNodes 102 " 103 Add n nodes. 104 105 Parameters 106 ---------- 107 n : int 108 the number of nodes to add. 109 110 Returns 111 ------- 112 Set of int 113 the new ids 114 " 115 116 %feature("docstring") gum::MixedGraph::empty 117 " 118 Check if the graph is empty. 119 120 Returns 121 ------- 122 bool 123 True if the graph is empty 124 " 125 126 %feature("docstring") gum::MixedGraph::emptyEdges 127 " 128 Check if the graph doesn't contains edges. 129 130 Returns 131 ------- 132 bool 133 True if the graph doesn't contains edges 134 " 135 136 %feature("docstring") gum::MixedGraph::eraseEdge 137 " 138 Erase the edge between n1 and n2. 139 140 Parameters 141 ---------- 142 n1 : int 143 the id of the tail node 144 n2 : int 145 the id of the head node 146 " 147 148 %feature("docstring") gum::MixedGraph::eraseNeighbours 149 " 150 Erase all the edges adjacent to a given node. 151 152 Parameters 153 ---------- 154 n : int 155 the id of the node 156 " 157 158 159 %feature("docstring") gum::MixedGraph::existsEdge 160 " 161 Check if an edge exists bewteen n1 and n2. 162 163 Parameters 164 ---------- 165 n1 : int 166 the id of one extremity of the edge 167 n2 : int 168 the id of the other extremity if tge edge 169 170 Returns 171 ------- 172 bool 173 True if the arc exists 174 " 175 176 %feature("docstring") gum::MixedGraph::existsNode 177 " 178 Check if a node with a certain id exists in the graph. 179 180 Parameters 181 ---------- 182 id : int 183 the checked id 184 185 Returns 186 ------- 187 bool 188 True if the node exists 189 " 190 191 192 %feature("docstring") gum::MixedGraph::size 193 " 194 Returns 195 ------- 196 int 197 the number of nodes in the graph 198 " 199 200 %feature("docstring") gum::MixedGraph::sizeEdges 201 " 202 Returns 203 ------- 204 int 205 the number of edges in the graph 206 " 207 208 %feature("docstring") gum::MixedGraph::toDot 209 " 210 Returns 211 ------- 212 str 213 a friendly display of the graph in DOT format 214 " 215 216 217 %feature("docstring") gum::MixedGraph::emptyArcs 218 " 219 Check if the graph doesn't contains arcs. 220 221 Returns 222 ------- 223 bool 224 True if the graph doesn't contains arcs 225 " 226 227 %feature("docstring") gum::MixedGraph::eraseArc 228 " 229 Erase the arc between n1 and n2. 230 231 Parameters 232 ---------- 233 n1 : int 234 the id of the tail node 235 n2 : int 236 the id of the head node 237 " 238 %feature("docstring") gum::MixedGraph::eraseChildren 239 " 240 Erase the arcs heading through the node's children. 241 242 Parameters 243 ---------- 244 n : int 245 the id of the parent node 246 " 247 248 %feature("docstring") gum::MixedGraph::eraseNode 249 " 250 Erase the node and all the related arcs and edges. 251 252 Parameters 253 ---------- 254 id : int 255 the id of the node 256 " 257 258 %feature("docstring") gum::MixedGraph::eraseParents 259 " 260 Erase the arcs coming to the node. 261 262 Parameters 263 ---------- 264 n : int 265 the id of the child node 266 " 267 268 %feature("docstring") gum::MixedGraph::existsArc 269 " 270 Check if an arc exists bewteen n1 and n2. 271 272 Parameters 273 ---------- 274 n1 : int 275 the id of the tail node 276 n2 : int 277 the id of the head node 278 279 Returns 280 ------- 281 bool 282 True if the arc exists 283 " 284 285 %feature("docstring") gum::MixedGraph::hasDirectedPath 286 " 287 Check if a directedpath exists bewteen from and to. 288 289 Parameters 290 ---------- 291 from : int 292 the id of the first node of the (possible) path 293 to : int 294 the id of the last node of the (possible) path 295 296 Returns 297 ------- 298 bool 299 True if the directed path exists 300 " 301 302 %feature("docstring") gum::MixedGraph::sizeArcs 303 " 304 Returns 305 ------- 306 int 307 the number of arcs in the graph 308 " 309